On 4/15/21 4:42 PM, Robert Walsh via Cocoa-dev wrote:
I have an Objective-C application that creates a WKWebView to collect form 
input.  The
form has a label, an input (password) field, and two buttons.  When the form is 
shown
inside the web view by the application, the user can click the buttons but 
cannot enter
text into the input field.  The system plays a sound to indicate that the key 
was
rejected.  I've tried adding a text area element to the form just to see if the 
problem
is with the input field itself, but the user cannot type in the text area 
either.  If I
take the same HTML/stylesheet content and open it in Safari, the input field 
accepts
keyboard input.

There is another area of the application that shows a different web page in the 
same
WKWebView component.  That page, too, contains a form with an input field, and 
the user
can type into that one.

I am using a WKWebView subclass so that I can trap mouse down events, but I do 
not have
any overloads for keyboard event handlers.

Maybe your WKWebView never becomes first responder (and therefore is never getting key input), perhaps as a result of the mouse-trapping that is going on. You can check if it becomes key by overriding

- (BOOL)becomeFirstResponder

in your subclass and setting a breakpoint there.

Best Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to