Tree: focus not updated correctly in various cases
ISTM focus on the tree isn't updated correctly in the following cases (or at least some of the following cases):
- focused node is deleted (by, for example, another user... and Tree receives delete notification)
- focused node's ancestor is deleted
- focused node is dragged and dropped into collapsed node, thus becoming hidden
Does focus go to "the right place" in these cases (whatever that means)? Or does it just disappear (or is that the "right thing")? Or does it move to another widget entirely, outside of tree?
Closing the ancestor of focused node seems to do the right thing:
if(this.lastFocused){
// are we collapsing a descendant with focus?
if(dojo.isDescendant(this.lastFocused.domNode, node.domNode)){
this.focusNode(node);
}else{
// clicking the expando node might have erased focus from
// the current item; restore it
this.focusNode(this.lastFocused);
}
}
Change History (13)
Description: |
modified (diff)
|
Milestone: |
1.2 →
future
|
Cc: |
Mike Wilcox added
|
Milestone: |
future →
1.4
|
Owner: |
changed from Becky Gibson to bill
|
Status: |
new →
assigned
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
Mike asked me for a fix to (1) and (2), I'm working on it now. Actually he just asked to avoid the exception when the user clicks on another TreeNode after the selected one was deleted out from under them. But I want to fix the tabbing problem too.
Oh, turns out the third bullet point is impossible:
because when you drop onto a collapsed node it automatically expands, and also because dropping sets the focus to the drop target.