#4664 closed defect (fixed)
tree item focus and onToggleOpen
Reported by: | guest | Owned by: | simonjb |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | Dijit | Version: | 0.9 |
Keywords: | tree onToggleOpen | Cc: | [email protected]…, alex |
Blocked By: | Blocking: |
Description
dojo: 0.90
browser: Explorer 6.0
error message: ... cannot activate hidden control ...
context: expand and collapse a subtree when the focused item is inside the subtree
proposed solution: modify 'onToggleOpen' in 'dijit\_treeController.js' (line 254) by adding 'node.tree.focusNode(node)' maybe after collapsing
onToggleOpen: function(/*Object*/ message){ // summary: user clicked the +/- icon; expand or collapse my children. var node = message.node; if(node.isExpanded){ this._collapse(node); node.tree.focusNode(node); // <<<< proposed solution }else{ this._expand(node); } },
Attachments (1)
Change History (10)
comment:1 Changed 14 years ago by
Milestone: | 2.0 → 1.0 |
---|---|
Owner: | set to simonjb |
comment:4 Changed 13 years ago by
David did the tree keyboard implementation but I'm happy to take this ticket.
comment:5 Changed 13 years ago by
Simon, I would try to make sure focus was in the subtree for the collapsing node prior to setting focus programmatically. (You're probably doing that anyways)
comment:6 Changed 13 years ago by
It turns out that there is actually already logic to move focus when collapsing a node. And it has a check to make sure that we are collapsing a subtree with focus. The check is always failing in IE. On IE it looks like focus is never in the collapsing subtree and focus is never moved. The logic checks for tabindex=0 using dojo.query. There are cross-browser issues with tabindex. We should address these but for now I thought I'd try a different approach. See attachment.
Changed 13 years ago by
Attachment: | 4664a.diff added |
---|
comment:7 Changed 13 years ago by
Cc: | alex added |
---|
Simon, that seems reasonable although if dojo.query("[tabindex=0]", node)
isn't working on IE can you file a separate bug about it, assigned to alex? (Hopefully there is a simple testcase like with some static HTML.)
comment:8 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [10926]) Use dojo.isDescendant() rather than dojo.query("[tabindex=0]") to check if we are collapsing a subtree with focus. dojo.query("[tabindex=0]") was always returning an empty list on IE. Also fixed a issue with focus being lost when collapsing a subtree that does not have focus. Fixes #4664.
comment:9 Changed 13 years ago by
(In [13122]) After dropping nodeC into nodeP, where nodeP is collapsed, this._lastFocused would still be pointing to nodeC, and clicking nodeP's expando would fail since it tried to refocus on nodeC even though nodeC was hidden. Workaround this by making expando-click focus on the node w/the expando. Maybe that's the right behavior anyway? Not sure. Fixes #6232. Refs #4664.
This seems worth doing for 1.0 if only a one line change. Simon, you did the tree stuff right?