Closed Bug 384601 Opened 17 years ago Closed 11 years ago

onclick fires on space key up even when there was no space down

Categories

(Core :: DOM: Events, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: davidb, Unassigned)

References

()

Details

Attachments

(1 file)

Currently if an element such as a button has an onclick handler, it will fire if the space key is released while on the element even if there was no previous space down on the element.

This is inconsistent with mouse buttons. An click will not fire if only a mouse up happens over the element.

DHTML applications that pop up UI are vulnerable to this.

A popular case would be a popup menu (over something like a button), that might react to a space key down, and dismiss, leaving the previously focused element to get the space up and onclick. One can imagine this causing potentially serious problems.

We noticed this behaviour during dijit development (dojotoolkit).
Note there might be other similar cases with for example stray enter key up events etc.
Also note it looks like a keypress fires on an enter-up with now prior enter-down. This similarly hazardous for DHTML apps.
(In reply to comment #2)
> Also note it looks like a keypress fires on an enter-up with now prior
> enter-down. This similarly hazardous for DHTML apps.
> 

That should say "no prior" sorry for typo.
I recently tried my test case and I think this has been fixed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: