Opened 14 years ago

Closed 14 years ago

#7832 closed task (fixed)

dijit._TreeNode widgets do not have own focused/blured events

Reported by: alex Owned by: bill
Priority: high Milestone: 1.3
Component: Dijit Version: 1.2.0
Keywords: tree, tree node, dijit, api Cc: dante, Adam Peller, Becky Gibson
Blocked By: Blocking:


in extending the dijit._TreeNode class to give it new formatting, I was surprised to find that the _onNodeFocus() event delegates to the containing tree widget which reaches into the nodes themselves to set and un-set WAI roles and states and the various css rules. This seems poorly factored. It should be the TreeNodes?' responsibility to respond to focus and blur events and set styles accordingly. No backwards-incompatible changes need to be made to make this happen.

Change History (5)

comment:1 Changed 14 years ago by bill

Milestone: 1.31.4

Looks like it TreeNode? calls Tree._onNodeFocus() so that:

  1. Tree can blur the currently focused node
  2. Tree keeps track of the currently focused node

I can see putting the styling code into _TreeNode though.

comment:2 Changed 14 years ago by bill

Milestone: 1.41.5

bumping 1.4 tickets to 1.5, and most 1.3 tickets to 1.4

comment:3 Changed 14 years ago by bill

Milestone: 1.51.3
Owner: set to bill
Status: newassigned

This code is a bit tangled up, and not trivial to fix. Focus is fairly simple but there are two types of "blur" operations:

  • in blurNode(), where focus is moved to another TreeNode?
  • in _onBlur(), where focus has been moved away from the whole tree

In the former case we are setting tabIndex to -1, but not in the latter case.

It's because Tree has a concept of a currently selected node, same as TabContainer? has a currently selected tab, even when focus is somewhere away from the tree.

comment:4 Changed 14 years ago by bill

Cc: Becky Gibson added

CC'ing becky in case she wants to look over the change I am checking in.

comment:5 Changed 14 years ago by bill

Resolution: fixed
Status: assignedclosed
Type: defecttask

Refactor completed in [16123].

Note: See TracTickets for help on using tickets.