Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#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:2 Changed 11 years ago by bill

Milestone: tbd1.4
Type: defectenhancement

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 10 years ago by bill

Milestone: 1.41.5
Owner: set to bill

comment:4 Changed 10 years ago by bill

Resolution: fixed
Status: newclosed

(In [21728]) Decouple concepts of "focused node" and "selected node", so that:

  1. A tree doesn't start with any node mark as selected; app needs to call attr("selectedItem", ...) or attr("path", ...). Fixes #8616.
  2. 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.

comment:5 Changed 10 years ago by bill

(In [21730]) Make clicking, double-clicking, or ENTER-keying a TreeNode select it. But clicking/double-clicking an expando node (plus sign) does not select the TreeNode. Still need to add tests. Refs #8616, #9953 !strict.

comment:6 Changed 10 years ago by bill

(In [21738]) Keyboard test case for TreeNode focus and selection. Tree still needs mouse tests written, currently there aren't any. Refs #8616, #9953 !strict.

comment:7 Changed 10 years ago by bill

(In [21739]) Keyboard test case for TreeNode focus and selection. Tree still needs mouse tests written, currently there aren't any. Refs #8616, #9953 !strict.

Note: See TracTickets for help on using tickets.