Repository navigation
Conversation
On iOS, hiding the keyboard without Done (a swipe down in GutenbergKit, or Safari's address bar) only blurs the page: the canvas stays focused. The next tap focuses the page again before mousedown, so the check for a tap that iOS already placed the caret for passed, and cancelling the mousedown left the caret where it was. Check focus at pointerdown, before the tap focuses the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +3 B (0%) Total Size: 8.69 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I want to be able to create a navigation overlay for a specific navigation block in
|
What?
On iOS, tapping the selected paragraph after the keyboard was hidden without Done now places the caret at the tap. Before, the keyboard came back but the caret stayed where it was.
Reported by @dcalhoun while testing #86923: in Safari after tapping the address bar, and in GutenbergKit after every swipe down that hides the keyboard.
Why?
Hiding the keyboard without Done (a swipe down in GutenbergKit, or tapping Safari's address bar) only blurs the page: the canvas stays the focused element. The next tap focuses the page again before
mousedown.useClickSelectioncancelsmousedownfor a tap in the selected block when the canvas is focused, because iOS normally places the caret on the tap itself (#81042). But iOS does not place it on a tap into a page without focus, so cancellingmousedownleft the caret where it was.How?
useClickSelectionchecks whether the canvas is focused atpointerdown, before the tap focuses the page, instead of atmousedown.The new iOS test hides the keyboard by dragging down into it, like GutenbergKit. The test app's web view now allows that (
keyboardDismissMode = .interactive).Testing Instructions
Open the demo post in Playground
testTapAfterSwipingKeyboardAwayPlacesCaretfails 10 of 10 on trunk and passes 10 of 10 with this change, on iOS 27 and 26.5.Testing Instructions for Keyboard
Unchanged: the change only affects a tap with a finger.
Screenshots or screencast
iOS 27 simulator, recorded while
testTapAfterSwipingKeyboardAwayPlacesCaretruns: the test taps the end of the paragraph, drags the keyboard away, taps the start of the paragraph and types X. While the keyboard slides away, iOS draws the caret sliding down with it; the caret itself stays at the end, as the X in Before shows.retap-before-trunk.mp4
retap-after.mp4
Use of AI Tools
Investigated and written with Claude Code: reproduced in the iOS simulator, wrote the iOS test, and ran the iOS and end-to-end tests.
🤖 Generated with Claude Code