refactor(ui5-input): events changes#8769
Merged
nikoletavnv merged 29 commits intomainfrom May 8, 2024
Merged
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
simonarangelova
approved these changes
Apr 25, 2024
ndeshev
reviewed
Apr 25, 2024
packages/main/src/MultiInput.ts
Outdated
| * | ||
| * - 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) |
Contributor
There was a problem hiding this comment.
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
Contributor
|
If one item is selected (with Enter or click) and then the same item is selected again, |
ndeshev
reviewed
Apr 25, 2024
… into input-events
… into input-events
Contributor
Author
|
I created a new bug regarding improper firing of the change event - #8912 |
ndeshev
approved these changes
May 8, 2024
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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