WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 192897
191768
[iOS] Cannot prevent default key command in onkeydown handler
https://bugs.webkit.org/show_bug.cgi?id=191768
Summary
[iOS] Cannot prevent default key command in onkeydown handler
Daniel Bates
Reported
2018-11-16 13:36:26 PST
A web page may implement their own key command handling and want to prevent the default browser behavior by calling Event.preventDefault() in their onkeydown handler. For example, a page may implement their own Find-in-page feature that is toggled by listening for Command + F, the same key command to trigger the default browser Find-in-page feature. Calling Event.preventDefault() in their onkeydown handler when they receive Command + F should prevent Safari from showing the Find-in-page UI. But it does not on iOS. It does on Mac.
Attachments
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2019-01-16 19:01:40 PST
(In reply to Daniel Bates from
comment #0
)
> A web page may implement their own key command handling and want to prevent > the default browser behavior by calling Event.preventDefault() in their > onkeydown handler. For example, a page may implement their own Find-in-page > feature that is toggled by listening for Command + F, the same key command > to trigger the default browser Find-in-page feature. Calling > Event.preventDefault() in their onkeydown handler when they receive Command > + F should prevent Safari from showing the Find-in-page UI. But it does not > on iOS. It does on Mac.
App key commands, like Command + F, should only be prevented from a key press handler to match Mac and the UIEvents spec.
Daniel Bates
Comment 2
2019-01-16 19:01:47 PST
*** This bug has been marked as a duplicate of
bug 192897
***
Radar WebKit Bug Importer
Comment 3
2019-01-16 19:02:01 PST
<
rdar://problem/47338324
>
Radar WebKit Bug Importer
Comment 4
2019-01-16 19:02:02 PST
<
rdar://problem/47338325
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug