-
Notifications
You must be signed in to change notification settings - Fork 272
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
refactor(ui5-input): events changes #8769
Conversation
BREAKING CHANGE: Remove suggestion-item-select event. Rename and modify suggestion-item-preview event. Remove openPicker method and replace it with public property "open".
… into input-events
… into input-events
… into input-events
… into input-events
packages/main/src/MultiInput.ts
Outdated
@@ -49,7 +48,7 @@ type MultiInputTokenDeleteEventDetail = { | |||
* Fiori Guidelines say that user should create tokens when: | |||
* | |||
* - Type a value in the input and press enter or focus out the input field (`change` event is fired) | |||
* - Select a value from the suggestion list (`suggestion-item-select` event is fired) | |||
* - Move between suggestion items or select suggestion item (`selection-change` event is fired) |
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 line is not clear. We fire 'selection-change' when moving (navigating) between suggestions, when an item is selected with click or ENTER we also fire a 'change' event to mark the end of the interaction
If one item is selected (with Enter or click) and then the same item is selected again, |
… into input-events
… into input-events
I created a new bug regarding improper firing of the change event - #8912 |
Remove suggestion-item-select event for ui5-input component. Remove previewItem property for ui5-input component. Rename event suggestion-item-preview to selection-change.
BREAKING CHANGE:
The suggestion-item-select event is no longer present for ui5-input component. Instead, the users can listen for the change event when a suggestion item is selected as input value.
The event suggestion-item-preview is replaced by selection-change event. It is fired when the user navigates among the suggestion items using the ARROWS keys. Also selection-change event is fired when the user opens the suggestions popover and directly clicks on a suggestion item, that is not marked as "selected" at the moment. The parameters dispatched with the selection-change event remain the same as the ones dispatched with the old suggestion-item-preview event.
The property previewItem, that returned the current suggestion item on preview, is no longer present. The user can listen for selection-change event in order to understand which suggestion item is on preview.
If you have previously attached to 'suggestion-item-preview' event:
Now you should attach to 'selection-change' event:
The event details remain the same. The only difference is that item and targetRef may be null, because 'selection-change' event is also fired when the input value no longer matches a selected suggestion.
If you have previously listened to 'suggestion-item-select' event to detect which suggestion item has been selected by the user:
Now you can detect which suggestion item was selected if you attach to 'selection-change event', keep the selected item in a variable and during 'change' event check if the input value matches the last selected item:
Accesing the suggestion item under preview was done like this:
Now you can attach to 'selection-change' event and get the previewed suggestion item from the event detail:
Related to: #8461