Bug 279030

Summary: Escape key does not fire keyup when exiting fullscreen
Product: WebKit Reporter: bitbof
Component: UI EventsAssignee: Abrar Rahman Protyasha <a_protyasha>
Status: NEW ---    
Severity: Normal CC: ap, jer.noble, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Mac (Apple Silicon)   
OS: macOS 14   

Description bitbof 2024-09-02 11:35:32 PDT
Steps to reproduce:
- On macOS, in Safari, open a webpage with window.addEventListener('keydown', ...) and window.addEventListener('keyup', ...)
- "Enter Full Screen" - via green window button or Ctrl + Cmd + F
- Press the escape key

Can also be tried with the logger here: https://bitbof.github.io/browser-bug-demos/2024-09-02-safari-mac-escape-key/

Actual results:

Does not fire keyup for escape key

Expected results:

Fires keydown and keyup for escape key
Comment 1 Alexey Proskuryakov 2024-09-02 11:52:50 PDT
Thank you for the report. This seems like a rather extreme edge case, could you please add some color around whether this is important for you and your users?
Comment 2 bitbof 2024-09-02 12:46:18 PDT
It breaks keyboard shortcuts in my app (it does happen to users), but there workarounds, and I can imagine a more robust implementation for keyboard shortcuts on my end. It would have been less confusing, but it's not that important.
Comment 3 Radar WebKit Bug Importer 2024-09-09 11:36:15 PDT
<rdar://problem/135564636>