-
Notifications
You must be signed in to change notification settings - Fork 85
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: clear filter when clicking matching value #3688
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.
Verified by manual testing that the PR solves the issue.
The only thing I'm not sure that I totally understand: what is the difference between the clear
and _clear
methods? They are both in the same scope.
web-components/packages/multi-select-combo-box/src/vaadin-multi-select-combo-box-internal.js
Lines 105 to 115 in 0a9c5e0
/** | |
* @param {!Event} event | |
* @protected | |
*/ | |
_onChange(event) { | |
super._onChange(event); | |
if (this._isClearButton(event)) { | |
this._clear(); | |
} | |
} |
web-components/packages/multi-select-combo-box/src/vaadin-multi-select-combo-box-internal.js
Lines 84 to 94 in 0a9c5e0
/** | |
* @protected | |
* @override | |
*/ | |
clear() { | |
super.clear(); | |
if (this.inputElement) { | |
this.inputElement.value = ''; | |
} | |
} |
packages/multi-select-combo-box/src/vaadin-multi-select-combo-box-internal.js
Outdated
Show resolved
Hide resolved
…box-internal.js Co-authored-by: Sergey Vinogradov <[email protected]>
Kudos, SonarCloud Quality Gate passed!
|
Good point. It looks like BTW, there is a similar |
This ticket/PR has been released with Vaadin 23.1.0.alpha3 and is also targeting the upcoming stable 23.1.0 version. |
Description
The issue with not clearing the input was coming from the fact that by default,
clear()
method only sets 'value' to empty string. However, it was already empty for an internal combo-box, so the observer to reset input value wasn't triggered.Updated to manually set
inputElement.value
to empty string. Also, added logic to resetfilter
property, so that the component shows all the items after clicking / pressing Enter on the matching item in the dropdown.Fixes #3644
Type of change