Ticket #3281 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Stray keyup event after menu closed via keyboard.

Reported by: davidb Owned by: davidb
Priority: normal Milestone: 0.9
Component: Dijit Version: 0.9
Severity: normal Keywords:
Cc: simonjb, becky

Description

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

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

Change History

Changed 3 years ago by davidb

Catch me, davidb on #dojo for more details.

Changed 3 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).

Changed 3 years ago by bill

  • owner changed from bill to davidb
  • milestone set to 0.9

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

Changed 3 years ago by davidb

Menus appear to have been recently broken?

Changed 3 years ago by davidb

Note broken menus has ticket 3433

Changed 3 years ago by davidb

fix (unpolished) posted for discussion

Changed 3 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.

Changed 3 years ago by davidb

  • status changed from new to assigned

Changed 3 years ago by davidb

  • status changed from assigned to closed
  • resolution set to fixed

Fixed via [9304]

Changed 3 years ago by bill

  • status changed from closed to closed
  • 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.