Bug 229600
| Summary: | WKWebView: cannot become first responder using focus() in JavaScript or native becomeFirstResponder() method | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Daohan Chong <dh.chong> |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ggaren, simon.fraser, thorton, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 14 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 13 | ||
Daohan Chong
For example, if we'd like to build a web based text editor, we'd like to automatically focus on the text input area in `UIViewController.viewDidAppear`.
However, we cannot build behavior like this using public API. For example, all these won't work:
- Calling `htmlElement.focus()` does nothing.
- `WKWebView.becomeFirstResponder()`
The community is trying to explore how to work around this missing feature: https://stackoverflow.com/questions/32449870/programmatically-focus-on-a-form-in-a-webview-wkwebview/48623286#48623286
This can be reproduced on iOS 13 to iOS 15 beta.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/82708554>