The default bug view has changed. See this FAQ.

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

RESOLVED WORKSFORME

Status

()

Core
DOM: Events
RESOLVED WORKSFORME
10 years ago
4 years ago

People

(Reporter: davidb, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
Created attachment 268496 [details]
shows that space up fires click?

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).
(Reporter)

Comment 1

10 years ago
Note there might be other similar cases with for example stray enter key up events etc.

Updated

10 years ago
(Reporter)

Comment 2

10 years ago
Also note it looks like a keypress fires on an enter-up with now prior enter-down. This similarly hazardous for DHTML apps.
(Reporter)

Comment 3

10 years ago
(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.
(Reporter)

Comment 4

4 years ago
I recently tried my test case and I think this has been fixed.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.