Open Bug 1013528 Opened 7 years ago Updated 5 years ago

Pressing The Escape Key in the system file browser also fires the main window's keyup event

Categories

(Core :: DOM: Events, defect)

29 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: djneoform, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36

Steps to reproduce:

Create a file input tag: <input type="file" />

Add a keyup listener to the window: 

window.onkeyup = function(e) {
    if ((e.keyCode || e.which) === 27) {
        alert("escape pressed");
    }
};

Click the file input, then close the dialog by hitting the escape key. 

Example: http://codepen.io/anon/pen/CwxKE


Actual results:

The keyup event is fired and an alert dialog is shown.


Expected results:

No alert should be shown.
Component: Untriaged → DOM: Events
Product: Firefox → Core
Also running into similar issue on latest FF (mac & win), Chrome on Win, & Safari.  Only Chrome/mac seems to handle it OK.
You need to log in before you can comment on or make changes to this bug.