Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#16933 closed defect (invalid)

dijit/_KeyNavMixin::focusChild() mistakenly invokes .focus()

Reported by: dbsalgad Owned by: dbsalgad
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

On line 167 of this module, there is a check for

if(!widget){
    return;
}

This should be changed to ensure that the widget also has a focus().

if(!widget || typeof widget.focus != "function"){ return; }

Otherwise you might encounter a bug like: "Uncaught TypeError?: Object [Widget dijit.MenuSeparator?, dijit_MenuSeparator_3] has no method 'focus'"

Change History (3)

comment:1 Changed 6 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Owner: set to dbsalgad
Status: newpending

It's not a mistake, it's a requirement that the child widget have a focus() method. In dojo we prefer exceptions to code that fails silently. I don't know why that initial code about if(!widget){ return; } is there; it probably shouldn't be. I traced in back to [10466], where it came from Menu, but didn't trace farther than that.

I tried test_Menu.html and didn't see any error about MenuSeparator. If you have a test case that fails please attach a it using the "attach file" button. It should be as small as possible to still reproduce the problem, almost always a single HiML file that we can load in the browser (i.e. not PHP, JSP, etc.)

Then, give exact instructions on how to reproduce the problem using your attached test file.

comment:2 Changed 6 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:3 Changed 6 years ago by dbsalgad

It appears this is no longer an issue. Our version of 1.8 had a dijit/_MenuBase whose onItemHover() invoked this.focusChild(item). Your version no longer does this.

Thanks for you help!

Note: See TracTickets for help on using tickets.