Repository navigation
fix(ios): make the web view first responder before autofocusing - #789
Merged
Merged
Conversation
iOS 27 no longer gives the web view first responder status when script focuses an element, so the title gained DOM focus without an input session and the keyboard never appeared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EStq5uGvLgsu7tD3iAKJcT
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/789")Built from 8cac1d4 |
dcalhoun
marked this pull request as ready for review
October 14, 2026 18:24
crazytonyli
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fix broken post title auto-focus for empty posts on iOS.
Why?
Auto-focus allows quick typing for new posts. The broken state originates to changes from iOS 27.
How?
Ensure the web view is the first responder before auto-focusing.
Testing Instructions
Accessibility Testing Instructions
N/A, no navigation changes.
Screenshots or screencast
N/A, no visual changes.
AI-generated details
Problem: On iOS 27, opening the editor for a new, empty post leaves the title without a caret or keyboard. iOS 26 and Android are unaffected.
Cause: The title already has DOM focus, but the web view is not first responder (
document.hasFocus()isfalse) wheneditor.focus()runs. iOS 27 no longer promotes the web view to first responder for script-driven focus, so no input session starts.Fix:
EditorViewController.focus(force:)callswebView.becomeFirstResponder()beforeeditor.focus().Verified on the iOS 27 simulator via the demo app:
isLockdownModeEnabled = trueon the web view config): the sheet presents without a keyboard; autofocus stays skipped.🤖 Generated with Claude Code
https://claude.ai/code/session_01EStq5uGvLgsu7tD3iAKJcT