Opened 9 years ago

Closed 8 years ago

#11533 closed defect (wontfix)

Tree: focusing of last treenode set by path

Reported by: Florian Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.5
Keywords: tree path Cc:
Blocked By: Blocking:


Since the release-version of dojo 1.5 "tree.set('path', pathArray)" correctly selects the the last treenode in the pathArray but does not focus it anymore: Is this behaviour intended? If you have a tree with many nodes it can be very annoying to scroll down to a selected node already openend by set('path')...

My current workaround is this one here

tree.set('path', pathArray).then(

but this certainly does not work with a declarative tree and its path-attribute...



Change History (5)

comment:1 Changed 9 years ago by bill

Component: GeneralDijit
Owner: anonymous deleted
Summary: focusing of last treenode set by pathTree: focusing of last treenode set by path

Hmm, do you really want it to focus the node, or just to do a setting so that when the user tabs into the tree they land on that node (ie, set tabindex=0 for that node)?

comment:2 Changed 9 years ago by Florian

In my case I really want set('path') to focus the last treenode in pathArray, but I admit that this is not the behaviour everyone wants... So if you state the set('path') is not meant for putting any focus I'll use my workaround above. Maybe you should put the example in the docs to help anyone with the same future question. :-)

comment:3 Changed 9 years ago by bill

Milestone: tbd1.6
Owner: set to bill
Status: newassigned

Probably it should at least set that TreeNode as the one that receives focus when the tree itself receives focus, so that you can do

tree.set('path', pathArray).then(function(){

(And if the Tree already has focus then it should focus that node.) I just went through the same exercise with Calendar. I'll do that and then document the rest, as you suggested.

comment:4 Changed 8 years ago by bill

Milestone: 1.61.7

comment:5 Changed 8 years ago by bill

Resolution: wontfix
Status: assignedclosed

Sorry, I started working on this and decided it's better not to automatically change focus to the selected node. Starting with 1.5 focus and selection were properly separated, to operate independently. Although it's probably a common case to want to set focus to the selected tree node, I don't want to hardwire that behavior.

Note: See TracTickets for help on using tickets.