-
Notifications
You must be signed in to change notification settings - Fork 322
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
feat: Ignore classes in useClickOutside hook #2135
Conversation
if (ignoreClasses && event.target instanceof HTMLElement) { | ||
if (event.target.closest(ignoreClasses.join(','))) { | ||
return; | ||
} | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🙏🏼
Support excluding classes when checking if a click occurred outside for useClickOutside hook.