#8616 closed enhancement (fixed)
Tree: first node is pre-selected when tree loaded
Reported by: | Les | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Dijit | Version: | 1.2.3 |
Keywords: | Tree | Cc: | |
Blocked By: | Blocking: |
Description
Load this page:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/tree/test...
Why the Continents and Africa nodes are selected? It appears there's no easy way to disable this default pre-selection. I'd like to have no nodes selected when the tree is loaded as in release 1.1.1 or 1.2.
Change History (7)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Milestone: | tbd → 1.4 |
---|---|
Type: | defect → enhancement |
Well, you could disable that style altogether by overriding the rule
.tundra .dijitTreeNodeSelected .dijitTreeLabel { background:#e2ebfe; }
or perhaps only show the styling when the Tree itself is focused, by disabling the rule above and modifying the rule below to include the background color:
.tundra .dijitTreeLabelFocused { outline: 1px invert dotted; }
That'll get you the 1.2 behavior.
Tree's all have (exactly one) focusable TreeNode at any given time, which also doubles as the selected node, hence this issue.
As far as actually supporting the idea of no tree node being selected even though one of the nodes has a tabIndex... will consider for 1.4.
comment:3 Changed 11 years ago by
Milestone: | 1.4 → 1.5 |
---|---|
Owner: | set to bill |
comment:4 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [21728]) Decouple concepts of "focused node" and "selected node", so that:
- A tree doesn't start with any node mark as selected; app needs to call attr("selectedItem", ...) or attr("path", ...). Fixes #8616.
- Using arrow keys to navigate in a Tree will not change the selected item. Fixes #9953.
I'm unclear what should happen when the user clicks a node (especially when clicking a branch node, which merely opens the node). For now, clicking a node does not select it.
!strict.
http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/tree/test_Tree_v1.html