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: prevent ItemNavigation from cycling by default #985

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

ilhan007
Copy link
Member

Background
By default the focus (managed by ItemNavigation) does not cycle trough the items, which turned out that has not been working.

Root Cause
We check for the cycle config when border cases are reached (first or last item), but the only thing we do is to fire a private event ("_borderReach"), but updating the index, so it actually makes a whole loop (cycle).

Fix
In these border cases we just update the internal index to 0 (when "top" border is reached) and items.length-1 (when "bottom" border is reached).

@ilhan007 ilhan007 merged commit 3d46e2d into master Nov 27, 2019
@ilhan007 ilhan007 deleted the fix-itemnavigation-cycle branch November 27, 2019 07:43
plamenivanov91 pushed a commit to plamenivanov91/ui5-webcomponents that referenced this pull request Nov 27, 2019
**Background**
By default the focus (managed by ItemNavigation) does not cycle trough the items, which turned out that has not been working.
**Root Cause**
We check for the `cycle` config when border cases are reached (first or last item), but the only thing we do is to fire a private event ("_borderReach"), but updating the index, so it actually makes a whole loop (cycle).
**Fix**
In these border cases we just update the internal index to `0` (when "top" border is reached) and `items.length-1` (when "bottom" border is reached).
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.

None yet

2 participants