Page search + ESC fires ESC event on page
Reported by
rudiedi...@gmail.com,
Aug 28 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36 Steps to reproduce the problem: 1. Go to https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement 2. Use CTRL + F to page search for "append". This will highlight a menu item in the Methods menu on the left 3. Close the page search with ESC to follow the link What is the expected behavior? The page search is hidden, and the link is selected/focused. What went wrong? The menu collapses, because hiding the page search fires an ESC event on the page (and ESC closes the menu on MDN). Did this work before? No Chrome version: 60.0.3112.101 Channel: n/a OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Firefox 54 does this correctly IMO: closing search is not part of the page, so it doesn't trigger an event. Hitting ESC again will close the menu, because it's part of the page now. I don't think this ever worked in Chrome, but I'm not sure. Original bug report at Mozilla for MDN: https://bugzilla.mozilla.org/show_bug.cgi?id=1393994 but this is a Chrome bug, not an MDN bug.
,
Aug 29 2017
I presume there isn't much to do here because the find dialog is closed on a keydown, but the escape on the page is dismissed on a key up I think. There ultimately is no real pairing between a keydown/keyup since you can move focus with a key depressed and you will always get a keyup when the new window has focus so it is a design of the web.
,
Aug 29 2017
You think Firefox is wrong and Chrome is right? Closing the search dialog should be completely separate IMO. This is not a design of the web, this is a browser UI issue.
,
Aug 29 2017
keyup gets leaked to the page when dismissing other browser UI elements: * Tab key in the address bar * Esc key when the page was previously focused in the following UI elements: * in the page info popup * in the add/edit bookmark popup * in the user profile selector popup * in any extension toolbar popup Regardless of how difficult this might be to fix, the observed behavior is definitely a bug because the leaked event has nothing to do with the web page. Just imagine your favorite desktop OS would leak Alt-Tab keyup on switching apps or an Esc key after dismissing some other app's pop-over window.
,
Aug 29 2017
I'm attaching a simple test html that prints keyboard/mouse events for easier repro.
,
Aug 29 2017
woxxom@ that does happen. In fact you can get this to happen in firefox as well. 1) Goto https://cdn.rawgit.com/w3c/uievents/gh-pages/tools/key-event-viewer.html 2) Blur the window 3) Press Alt key 4) Focus input with mouse 5) Release Alt key. Both firefox and chrome report the keyup. That is the exact same scenario as dismissing an active dialog. What you really want to know on the key up is "Was there an associated keydown that was unhandled?"
,
Aug 29 2017
Okay, but since Chrome shows both views it can decide what to do. The user doesn't intentionally switch views/windows so this is a different use case. Anyway, isn't it technically possible to track the corresponding keyup? I don't remember much of WINAPI, though.
,
Aug 31 2017
It is technically possible to track them but I don't think any OS guarantees they come in pairs. So this is fixable in the javascript as well. Any idea why a keyup listener is used and not a keydown. I presume not a KeyPress because chrome doesn't fire a keypress on escape.
,
Sep 7 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by rudiedi...@gmail.com
, Aug 28 2017