-
Notifications
You must be signed in to change notification settings - Fork 58
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
fix: search and filter panel no longer opens when dismissing a filter #1093
fix: search and filter panel no longer opens when dismissing a filter #1093
Conversation
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.
I think stopPropagation
works well here - LGTM unless @bartaz has other thoughts.
dd39714
to
eb14124
Compare
LGTM, thank you ! |
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.
LGTM :)
🎉 This PR is included in version 1.2.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Wow, this has been around for a long time. Great improvement, I like it 👍 |
Done
Fixes the search & filter component re-opening the filter panel when removing a filter. The component will now behave as it does in the behaviour spec
The problem
The search & filter component has an on-click handler that opens the filter panel. This is currently being triggered by any clicks within the search and filter element and its descendants. This means that when a user clicks a chip dismissal button, the event bubbles up to the search & filter component & shows the filter panel.
Proposed solution
Chip
component'sonDismiss
callback.event.stopPropagation
in theonDismiss
callback passed into the filter chips by the search & filter componentAnother possible solution
I initially tried another solution that removed the
onClick
handler from the search and filter component and moved it to theonFocus
callback of the search input textbox. This also solves the issue, however it loses some functionality as clicking anywhere in the search and filter no longer opens the filter panel, and the only way to open the filter panel when it is overflowed is to click the CTA. So, I abandoned this approach for the approach in this PR.Storybook
To see rendered examples of all react-components, run:
QA in your project
from
react-components
run:Install the resulting tarball in your project with:
QA steps
Percy steps
Fixes
Fixes: #621