Bug 206887

Summary: Keyboard input doesn't work in WKWebView
Product: WebKit Reporter: Ashley Gullen <ashley>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dbates, megan_gardner, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: iPhone / iPad   
OS: iOS 13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=269292

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>