Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#15153 closed defect (fixed)

Tree: keypress handling issue on custom TreeNode class with nested widgets

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.7.6
Component: Dijit Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

Tree.js has the following code:

_onKeyPress: function(/*Event*/ e){
        // summary:
        //              Translates keypress events into commands for the controller
        if(e.altKey){ return; }
        var treeNode = registry.getEnclosingWidget(e.target);
        if(!treeNode){ return; }

It assumes that the enclosing widget of the event target is a TreeNode, but with a custom TreeNode class with nested widgets, this may not be the case.

Attachments (1)

widget_tree.html (3.0 KB) - added by bill 8 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 years ago by bill

Milestone: tbd1.8
Owner: set to bill
Status: newassigned

comment:2 Changed 8 years ago by bill

Resolution: fixed
Status: assignedclosed

In [28310]:

Use the same on.selector() method for keyboard events as click events... it's more resilient for Trees with custom TreeNodes that have nested widgets, in which case the getEnclosingWidget() call might return one of the nested widgets rather than the TreeNode.

This also switches to pure use of dojo/on, which means that the keypress event is no longer normalized to mozilla behavior, so had to handle those browser differences myself.

Fixes #15153, refs #14896 !strict.

Changed 8 years ago by bill

Attachment: widget_tree.html added

comment:4 Changed 8 years ago by bill

In [28315]:

Add test case and fix another problem for Tree with custom TreeNode class with supporting widgets, refs #15153 !strict

comment:5 Changed 8 years ago by bill

In [28335]:

"char" is a reserved word, so use a different variable name, refs #15153 !strict

comment:6 Changed 7 years ago by bill

In [31104]:

Test should not be clicking the TreeNode since that's actually a link to go to another page. Fixes test on IE10. Refs #15153 !strict.

comment:7 Changed 5 years ago by Bill Keese <bill@…>

In 2b8acb647169c38dbe2c3d6e3f569c0847d4ea29/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:8 Changed 5 years ago by bill

Milestone: 1.81.7.6

comment:9 Changed 5 years ago by Colin Snover <github.com@…>

In 6d1dda048883e9b62956c2a69f71efde5be3ca67/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.