Bug 206887 - Keyboard input doesn't work in WKWebView
Summary: Keyboard input doesn't work in WKWebView
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari 13
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-28 09:25 PST by Ashley Gullen
Modified: 2024-02-19 17:16 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ashley Gullen 2020-01-28 09:25:30 PST
Using a keyboard attachment to an iPad.

"keydown" events never fire in WKWebView if you preventDefault() on "touchstart" events.

Minimal repro: https://www.scirra.com/labs/bugs/keypresses.html

Steps to reproduce:
1. Set up device with keyboard
2. View URL in Safari. Press a key. Observe keyboard input.
3. View URL in WKWebView. Press a key.

Expected: also receive keyboard input
Observed: no keyboard input received

If we remove the call to preventDefault() in "touchstart", it starts working again in WKWebView. However we need to call preventDefault() for other reasons. It shouldn't block keyboard input. It works correctly in Safari, only WKWebView is blocking keyboard input.
Comment 1 Ashley Gullen 2020-01-28 09:44:43 PST
Just to clarify - this report pertains to a physical keyboard, not the on-screen keyboard.
Comment 2 Radar WebKit Bug Importer 2020-01-29 13:58:46 PST
<rdar://problem/59005584>