Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4d0798bc6ead79eef655fe887a0e052c4b2e4c49
      
https://github.com/WebKit/WebKit/commit/4d0798bc6ead79eef655fe887a0e052c4b2e4c49
  Author: Lily Spiniolas <[email protected]>
  Date:   2025-09-05 (Fri, 05 Sep 2025)

  Changed paths:
    M 
LayoutTests/editing/selection/ios/tap-to-change-selection-after-accepting-inline-prediction.html
    A 
LayoutTests/fast/forms/ios/keyboard-restoration-after-element-replacement-expected.txt
    A 
LayoutTests/fast/forms/ios/keyboard-restoration-after-element-replacement.html
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

  Log Message:
  -----------
  Keyboard closes after typing one character in gif search field on x.com
https://bugs.webkit.org/show_bug.cgi?id=298304
rdar://146920597

Reviewed by Wenson Hsieh and Abrar Rahman Protyasha.

If the keyboard is hidden and an element is programatically focused during
the same presentation update, allow the keyboard to show again.

Track explicit user dismissals of the keyboard using `_editingEndedWithReason`,
and only restore the keyboard if `_editingEndedWithReason` is false.

With these changes, layout test
tap-to-change-selection-after-accepting-inline-prediction.html began to fail
due to it using `<body contenteditable>` as the focused element. When
the body was blurred, focus was restored to the body again, and the keyboard
remained open as a result. The test has been updated to use `<div 
contenteditable>`
instead so that the keyboard is correctly dismissed.

* 
LayoutTests/editing/selection/ios/tap-to-change-selection-after-accepting-inline-prediction.html:
* 
LayoutTests/fast/forms/ios/keyboard-restoration-after-element-replacement-expected.txt:
 Added.
* 
LayoutTests/fast/forms/ios/keyboard-restoration-after-element-replacement.html: 
Added.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setUpInteraction]):
(-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
(-[WKContentView _didCommitLoadForMainFrame]):
(-[WKContentView _hideKeyboard]):
(-[WKContentView 
_elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):

Canonical link: https://commits.webkit.org/299615@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to