Skip to content

fix(ui5-select): Selection now changes instantly #2031

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

Merged
merged 2 commits into from
Jul 29, 2020

Conversation

vladitasev
Copy link
Contributor

In order for the selection to be smooth, the focus/selection handling should be done internally by the list. Otherwise the select will always be one step behind and the focus will always lag behind the selected item.

Changes:

  • The list gets a new mode: SingleSelectAuto that changes the selection when the user presses the arrows. So in fact the focused item is always selected (automatically, hence the name).
  • The select uses the new list mode and handles selection change and item click. The only difference is that on selection change the popup is not closed and on item click it is.
  • The keyboard handling code that used to be in one function for both modes (when popup closed, when popup open) is now naturally split in 2 parts: when the popup is open, handle only esc/enter, as the list already handles everything else internally, and when the popup is closed, handle only arrow up/arrow down.

closes: #1992

Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

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

Works perfect!

@vladitasev vladitasev merged commit 88ceb83 into master Jul 29, 2020
@vladitasev vladitasev deleted the select-selection-refactor branch July 29, 2020 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select: the focus on items navigation moves too slow
2 participants