-
-
Notifications
You must be signed in to change notification settings - Fork 604
-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
When clicking in a scrolled tree for the first time, focus is not set properly #712
Comments
mar10
pushed a commit
that referenced
this issue
Apr 1, 2017
…op (#713) * Setting focus to first item should not be necessary in scroll demo * Ensure tree item is focused *after* mouse click has had a chance to set focus. Currently treeSetFocus will focus the first tree item if nothing else had focus. However, a mouse click does not have a chance to set focus until after the mouse is released. In order for the treeSetFocus to know that something was focused with the mouse, we need to: 1) Set focus on a tree item immediately on a mousedown 2) Use a setTimeout(ensureFocus, 0) in treeSetFocus to ensure that it runs after the mousedown handler This prevents the tree from scrolling back up when the user clicks in it. * Fix tests
Thanks, I merged. In the past, I found the focus handling a bit tricky, so let's see what happens ;) |
eramitmittal
added a commit
to iongroup/fancytree
that referenced
this issue
Jan 25, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: I have a PR coming for this.
Expected and actual behavior
When clicking in a scrolled tree, if autoScroll option is true, then the tree scrolls back to the top.
Steps to reproduce the problem
The removed code should not be necessary in order to get a scrollable tree to work. The PR will show a better way to handle the click-to-focus situation.
Could you set up a jsFiddle (http://jsfiddle.net/mar10/KcxRd/)
Yes -> http://jsfiddle.net/KcxRd/1032/
Environment
The text was updated successfully, but these errors were encountered: