Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3281 closed defect (fixed)

Stray keyup event after menu closed via keyboard.

Reported by: davidb Owned by: davidb
Priority: high Milestone: 0.9
Component: Dijit Version: 0.9
Keywords: Cc: simonjb, becky
Blocked by: Blocking:


Here is a known example:

  1. a popup menu is invoked.
  2. a menu item is selected via the spacebar,
  3. the menu item activation happens when the space key is pressed down,
  4. the menu is closed
  5. focus returns to wherever it was before the menu popped up
    • it appears the browser now has a stray keyup event to deal with...
  6. the problem can occur if the focus returns to a dom node.
  7. the browser maps the stray keyup event to the currently focused node.
  8. if the newly focused node has an onclick handler, it will fire.
    • presumably a space bar keyup event can fire an onclick generally (depends on browser?).
    • presumably if the node is listening for keyup events this can be a potential problem for any keypress event that closes the menu.

This is confirmed to happen at least in FF2.

(I think this blocks 3062)

Attachments (1)

3281-stray-event.diff (2.6 KB) - added by davidb 10 years ago.
fix (unpolished) posted for discussion

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by davidb

Catch me, davidb on #dojo for more details.

comment:2 Changed 10 years ago by davidb

To test this in dijit/form/test_Button.html:

In FF2 on windows or linux:

  1. tab to the edit drop down button
  2. invoke via enter or space key
  3. select a menuitem (the default/first one) via space key
  4. note the menu re-pops up after closing.

I believe this is because of a stray space key up event (described in the ticket above).

comment:3 Changed 10 years ago by bill

  • Milestone set to 0.9
  • Owner changed from bill to davidb

OK, just mailed David... I'd like you to try firing the menu on onkeyup and see if that can solve this problem elegantly.

comment:4 Changed 10 years ago by davidb

Menus appear to have been recently broken?

comment:5 Changed 10 years ago by davidb

Note broken menus has ticket 3433

Changed 10 years ago by davidb

fix (unpolished) posted for discussion

comment:6 Changed 10 years ago by davidb

The "fix" I just posted (for discussion) reintroduces #3428 because drop down was fixed to cause the popup on a key down event.

Things should only popup or close on a key down XOR a key up. We need to decide which.

comment:7 Changed 10 years ago by davidb

  • Status changed from new to assigned

comment:8 Changed 10 years ago by davidb

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed via [9304]

comment:9 Changed 10 years ago by bill

  • Resolution set to fixed

(In [9731]) Just some fixup to properly support the two signatures of dijit.focus(), even if the argument is dijit.focus({ node: null, ... }).

Fixes #3281.

Note: See TracTickets for help on using tickets.