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

Keyboard navigation and autoScroll #611

Merged
merged 1 commit into from
Jul 3, 2016
Merged

Conversation

Koloto
Copy link
Contributor

@Koloto Koloto commented Jul 1, 2016

The core of the keyboard navigation is navigate method. It calls makeVisible and then setFocus/setActive. makeVisible calls scrollIntoView in its turn. But if option autoScroll is specified setFocus and setActive also call scrollIntoView. So scrolling runs two times. Look at the sample-scroll.html (before this PR). You can see that the tree shakes a little while scrolling with a keyboard.

Also I suppose that keyboard navigation should take into account autoScroll option. When autoScroll is off keyboard navigation must not scroll the tree. Now it always scroll. I handle activate event, execute some custom logic there and then call scrollIntoView explicitly. But keyboard navigation scrolls extra time and I can't turn it off.

So I propose to call makeVisible({scrollIntoView: false}) in navigate method. If autoScroll is true, setFocus/setActive will scroll later.

@mar10 mar10 merged commit 707dce8 into mar10:master Jul 3, 2016
@mar10
Copy link
Owner

mar10 commented Jul 3, 2016

will merge, thanks. Let's see what happens...

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.

2 participants