Skip to content

Commit

Permalink
[visionOS] WKContentView doesn't relinquish first responder after tap…
Browse files Browse the repository at this point in the history
…ping Safari unified field

https://bugs.webkit.org/show_bug.cgi?id=260060
rdar://113732040

Reviewed by Wenson Hsieh.

The keyboard request dismissal can happen *after* the firstResponder chain
is affected by the dismissal and in fact this does happen on visionOS. By
also checking _isEditable we ensure that even if the firstResponder is the
content view but was not before the dismissal, we don't incorrectly set the
keyboard lock to true (blocking the next attempted resignation), as
_isEditable is not yet true in this case.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _keyboardDidRequestDismissal:]):
Require the content view is firstResponder AND editable to block the next
firstResponder resignation attempt.

Canonical link: https://commits.webkit.org/266863@main
  • Loading branch information
rsfuller authored and whsieh committed Aug 14, 2023
1 parent 46e2ecf commit 8222cb1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4204,9 +4204,8 @@ - (void)_didHideMenu:(NSNotification *)notification

- (void)_keyboardDidRequestDismissal:(NSNotification *)notification
{
if (![self isFirstResponder])
return;
_keyboardDidRequestDismissal = YES;
if (_isEditable && [self isFirstResponder])
_keyboardDidRequestDismissal = YES;
}

- (void)copyForWebView:(id)sender
Expand Down

0 comments on commit 8222cb1

Please sign in to comment.