Open Bug 816437 Opened 12 years ago Updated 2 years ago

spacebar triggers click event on wrong element

Categories

(Core :: DOM: Events, defect, P5)

17 Branch
x86
Windows Server 2003
defect

Tracking

()

UNCONFIRMED

People

(Reporter: frank, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Steps to reproduce:

Using javascript, I have an input element.
If 'spacebar' is pressed, under some circumstances, a custom dialog box with an 'Ok' button is created with setTimeout(..., 0).
On pressing 'Ok', the dialog is dismissed.


Actual results:

The dialog box appears and then immediately disappears.

It seems that the keyup event from the spacebar is caught by the 'Ok' button, which generates a 'click' event, which closes the dialog box.


Expected results:

The dialog box should stay open until the user dismisses it with a mouseclick, <enter>, or <space>.

This is what happens with all other browsers (IE8, Chrome, Opera, Safari).
Component: General → DOM: Events
Attachment #686468 - Attachment mime type: text/plain → text/html
I tried with FF17 and IE9 on Win 7, same result. The spacebar opens the dialog box that stays open and each event from the spacebar generates a click event.
On linux pressing spacebar opens the dialog, and clicking the button or pressing it doesn't dismiss
it. Same behavior on Chrome and Firefox (Nightly) and Opera.
The attached html file is a stripped down example intended to demonstrate the problem in the simplest way possible.

Clicking the button does *not* dismiss the dialog, it simply displays the word 'CLICK'.

You will see that when you press SPACE on the first window, the second window appears *and* the word CLICK appears, even though the button has not been clicked.

I have now tested this on linux (Fedora 14, FF17) and it shows the same problem.

Apologies for any confusion.
Ah, now I understand.
Reproduced on Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: