-
Notifications
You must be signed in to change notification settings - Fork 83
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: consider a value matching selected item label a known value #3302
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
await aTimeout(0); | ||
await nextFrame(); | ||
|
||
comboBox.value = comboBox.items[50]; | ||
comboBox.close(); | ||
|
||
comboBox.open(); | ||
await aTimeout(0); | ||
await nextFrame(); |
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 test was failing on master also for some reason. Changed the timings in the test to make it pass.
|
||
// Try to find an item whose label matches the input value. A matching item is searched from | ||
// the filteredItems array (if available) and the selectedItem (if available). | ||
const itemMatchingByLabel = [...(this.filteredItems || []), this.selectedItem].find((item) => { |
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.
Cleaned up the logic a bit, but the main change here is that matching items are no longer searched only from the filteredItems
array (which gets cleared by comboBoxConnector
, producing the original bug) but also from selectedItem
.
…) (#3304) Co-authored-by: Tomi Virkki <[email protected]>
This ticket/PR has been released with platform 23.0.0.alpha3 and is also targeting the upcoming stable 23.0.0 version. |
Part of vaadin/flow-components#2524
This change fixes the main issue in vaadin/flow-components#2524:
The "custom-item-set" event was dispatched even when the value matched the label of
comboBox.selectedItem
.There's still another issue related to vaadin/flow-components#2524 (the dropdown doesn't populate on the first open after setting new items) but it will be fixed separately.