Skip to content
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(ui5-combobox): fire selection-change event when typed word fully matches an item #10524

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nikoletavnv
Copy link
Member

Fixes #10239

When combobox is in noTypeahead mode, if the user writes a text that matches exactly a list item, selection-change event was not fired if the user selects the item by clicking on it.
Now the selection-change event fires when item text is exactly typed and immediately selected from the items list.

…matches item

Fixes #10239

When combobox is in noTypeahead mode, if the user writes a text that matches exactly
a list item, selection-change event was not fired if the user selects the item by
clicking on it.
Now the selection0change event fires when item text is exactly typed and
immediately selected from the items list.
…matches item

Fixes #10239

When combobox is in noTypeahead mode, if the user writes a text that matches exactly
a list item, selection-change event was not fired if the user selects the item by
clicking on it.
Now the selection0change event fires when item text is exactly typed and
immediately selected from the items list.
@@ -1118,15 +1118,16 @@ class ComboBox extends UI5Element implements IFormInputElement {

const sameItemSelected = this.value === this._selectedItemText;
const sameSelectionPerformed = this.value.toLowerCase() === this.filterValue.toLowerCase();
const shouldFireSelectionEvent = this.noTypeahead && this._lastValue !== this.value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this check is correct. There is a case where we select an item from the picker and then delete last character from the value and select the same item again. Since the typeahead is off, no selection has been performed during the value change therefore I believe the event should be fired just once, but now it's fired twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants