-
Notifications
You must be signed in to change notification settings - Fork 25
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: filters: clear search values when clear or clear all occurs #5006
Conversation
Thanks for the PR! 🎉 We've deployed an automatic preview for this PR - you can see your changes here:
Note The build needs to finish before your changes are deployed. |
const searchInput = this.shadowRoot.querySelector('d2l-input-search'); | ||
if (searchInput) searchInput.value = ''; |
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.
This isn't great. I haven't been able so far to force this search to re-render since its value
technically isn't changing for the case where the user hasn't actually executed the search (the value within d2l-input-search
is changing but not the one that filter
is rendering). Let me know any suggestions here.
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.
Is that because dimension.searchValue
doesn't change until they execute the search? Could its value be set to empty?
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.
Yup I believe that's correct. It's getting set to empty string in _handleClearSearch
but it already was empty so to filter nothing has changed.
@@ -735,6 +735,12 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) { | |||
_handleClear() { | |||
const dimension = this._getActiveDimension(); | |||
|
|||
if (dimension.searchType !== 'none') { | |||
this._handleClearSearch(dimension); |
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.
Clicking the "Clear" button within a single button was not clearing the search. I confirmed with Jeff that we would want it to. "Clear All" already clears all the searches within the filter so this makes that consistent.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
🎉 This PR is included in version 3.44.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Jira ticket
Problems:
To do: