Bug 239358 - No caret displayed in input elements in WKWebView when clicked or programatically focused in a catalyst app
Summary: No caret displayed in input elements in WKWebView when clicked or programatic...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-14 16:17 PDT by andrews
Modified: 2022-04-21 17:14 PDT (History)
5 users (show)

See Also:


Attachments
A simple mac catalyst app that has a wkwebview for the steps described. (71.14 KB, application/zip)
2022-04-14 16:17 PDT, andrews
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description andrews 2022-04-14 16:17:20 PDT
Created attachment 457655 [details]
A simple mac catalyst app that has a wkwebview for the steps described.

I have a mac catalyst app using a wkwebview. Within that I am using a contentEditable div but the same issue occurs with an input or textarea. Namely when one clicks on said element it will get keyboard focus but does not render a caret until you click it again. Similarly this happens if you programatically focus the wkwebview.

Scenario 1:
* Run app
* Click either the box under the content editable label, textarea label or input label.

Results:
No caret is displayed (or you see a solid non-blinking line). Technically you can type at this point as see that it has focus. If you click it again then you will get the blinking caret.

Scenario 2:
* Run the app
* Click into the content editable box, the textarea box or input box.
* Click it again. (Not required but you’ll see the caret blinking.
* Click in the textfield below the “Click To Focus” label so that the textfield becomes the first responder
* Click/tao the “Click To Focus” label.

Results:
No caret is displayed. Again technically you can type so it has keyboard focus. Note clicking the label again won’t help but if you click in the editable element it will start to show the caret.
Comment 1 Ryan Haddad 2022-04-21 17:14:42 PDT
rdar://92128208