Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Ignore classes in useClickOutside hook #2135

Merged

Conversation

omernave
Copy link
Contributor

Support excluding classes when checking if a click occurred outside for useClickOutside hook.

@omernave omernave requested a review from a team as a code owner May 22, 2024 11:35
Comment on lines 22 to 26
if (ignoreClasses && event.target instanceof HTMLElement) {
if (event.target.closest(ignoreClasses.join(','))) {
return;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: avoid nested if statement, the condition can be extracted to a variable to simplify the statement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@talkor talkor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🙏🏼

@talkor talkor changed the title Ignore classes in useClickOutside hook feat: Ignore classes in useClickOutside hook May 26, 2024
@talkor talkor merged commit ea42d2b into mondaycom:master May 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants