Opened 13 years ago
Closed 13 years ago
#6806 closed defect (fixed)
Tree gets multiple tab stops
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Accessibility | Version: | 1.1.0 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
- Expand Europe (using mouse!). Europe gets the focus.
- Press shift tab. BUG! Continents gets the focus.
- Reload browser. Europe should still be expanded.
- Press tab until focus arrives on the tree. Continents gets the focus.
- Press tab again. BUG! Europe gets the focus.
I think the patch below fixes both problems, but I haven't done a lot of testing.
Perhaps a better way to fix it would be to add a setLastFocused() method to Tree so we are setting tabindex in just one place (and so that users can set the lastFocused node if desired :-).
--- a/js-src/dijit/Tree.js +++ b/js-src/dijit/Tree.js @@ -210,10 +210,11 @@ dojo.declare( // On initial tree show, put focus on either the root node of the tree, // or the first child, if the root node is hidden - if(!this.parent){ + if(this == tree.rootNode){ var fc = this.tree.showRoot ? this : this.getChildren()[0], tabnode = fc ? fc.labelNode : this.domNode; tabnode.setAttribute("tabIndex", "0"); + tree.lastFocused = fc; } // create animations for showing/hiding the children (if children exist)
Thanks, Chris Heath
Change History (3)
comment:1 Changed 13 years ago by
Owner: | changed from Becky Gibson to bill |
---|---|
Status: | new → assigned |
comment:2 Changed 13 years ago by
When I was debugging it, this.parent was always false/undefined. To be honest, I'm not sure if it ever gets set.
So I was seeing the if being called too many times (once for each expanded subtree).
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This was fixed by [13784], should have been closed automatically.
Note: See
TracTickets for help on using
tickets.
Hi Chris thanks for the test case and patch! Usually we require CLAs but since this is just two lines I think I can just change. (But bigger patches are always welcome assuming you've signed the CLA.)
BTW was the line
if(!this.parent)
failing, or is it just thatthis == tree.rootNode
is clearer?