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

feat(framework): ItemNavigation cyclic behavior implemented for multiple rows #2780

Merged
merged 5 commits into from
Feb 5, 2021

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Feb 4, 2021

Changes:

  • ItemNavigation is now fully synchronous, it no longer awaits for rendering to have finished as it no longer needs to (this was necessary in the past when there were item navigation events such as "borderReached" that could trigger invalidation).
  • When behavior is set to Cyclic and rowSize is set to a number greater than 1 (the items are represented as a matrix rather than a vector), reaching the end of a row moves the focus to the next row and reaching the end of a column moves the focus to the next column and vice versa. Reaching the last item in the matrix moves the focus to the first and vice versa, creating a loop.
  • ItemNavigation was refactored: some functions unified (onkeydown + _onKeyPress since they are part of the same logic), others deleted (because they were just returning private members), the event object is no longer passed several times only to be prevented, but is prevented directly inside the event handler, as is the best practice.

The Cyclic item navigation behavior was applied to ProductSwitch.js, because it works well even when the matrix is not complete (the last row has fewer items). In contrast, the current Static ProductSwitch.js item navigation behavior could be considered strange when operating on incomplete rows, because the focus "jumps" to the last item skipping several items.

In addition, removed the console.log from the bundle.esm.js file as it is too spammy during tests execution.

Related to: #2731

@tsanislavgatev
Copy link
Contributor

As far it's concerning the behaviour that we've talked about it perfectly working.

@vladitasev vladitasev merged commit b7ad1ea into master Feb 5, 2021
@vladitasev vladitasev deleted the item-nav-fixes branch February 5, 2021 13:19
@vladitasev
Copy link
Contributor Author

@tsanislavgatev Merged, please pull :)

NHristov-sap pushed a commit to NHristov-sap/ui5-webcomponents that referenced this pull request Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants