Skip to content

fix: disable editableRoot for Paragraph and List Item blocks - #821

Merged
dcalhoun merged 2 commits into
trunkfrom
fix/disable-editable-root-ios-caret
Oct 26, 2026
Merged

dcalhoun merged 2 commits into
trunkfrom
fix/disable-editable-root-ios-caret

Conversation

@dcalhoun

@dcalhoun dcalhoun commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What?

Revert editable root changes from upstream Gutenberg core via a patch. Upstream is iterating on improving iOS text selection, the various PRs are listed in the details section collapsed at the bottom.

Why?

The iterations create severe instability in moving the caret between the title and content. Placing the cursor often fails, where the targeted title/block is "selected" by Gutenberg, but the caret is not within the actual field itself. This occurs most notably when moving between the title and content.

How?

Add patch to remove the editableRoot opt in. We should remove this patch once the problems are addressed upstream.

Testing Instructions

  1. On iOS, open a post with a title and a couple of paragraphs
  2. Tap to move the caret between the title and each paragraph, repeat in a variety of order
  3. Verify the caret moves where you tapped consistently
  4. Verify content is scrolled into view consistently

Accessibility Testing Instructions

N/A, no navigation changes.

Screenshots or screencast

Recording exhibiting the bug before these changes:

gbk-caret-movement.mov

AI-generated details

Since c761edb (#735), tapping on iOS often fails to move or show the caret (most noticeably into the post title), typing doesn't reach the newly selected block, and the caret scrolls beneath the block toolbar.

Cause: gutenberg#81542 re-added the private editableRoot opt-in to the Paragraph block (block-library 11.1.0), and gutenberg#82816 added it to List Item (11.2.0). Selecting either block makes the writing flow wrapper contenteditable="true" and moves focus to it, so taps land inside one large editing host instead of focusing the tapped field.

Fix: patch both opt-ins out, restoring the pre-#735 behavior. This gives up cross-block text selection on mobile web, which GBK didn't have before #735 anyway.

Gutenberg references

Merged:

Open:

Testing: on iOS, tap between paragraphs, list items, and the post title. The caret should land where tapped, typing should go into the selected block, and the caret should stay visible above the toolbar.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EB2aXCE1bcZisf7iy9zTLs

Selecting either block makes the writing flow wrapper an editing host
that takes focus, which breaks iOS caret placement, typing, and caret
scrolling. Keep the patch until upstream's iOS fix (gutenberg#81042)
ships in a release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Type] Bug An existing feature does not function as intended label Oct 21, 2026
@wpmobilebot

wpmobilebot commented Oct 21, 2026 •

Copy link
Copy Markdown

XCFramework Build

This PR's XCFramework is available for testing. Add the following to your Package.swift:

.package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/821")

Built from d90ac7f

Gutenberg#82816 reverted most of #81042, so its release does not fix
the iOS caret issues; tie removal to an actual upstream fix instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EB2aXCE1bcZisf7iy9zTLs
@crazytonyli

Copy link
Copy Markdown
Contributor

Would the patch cause any trouble on Android, since it also revert the changes in the Android library?

@dcalhoun

Copy link
Copy Markdown
Member Author

Would the patch cause any trouble on Android, since it also revert the changes in the Android library?

No, it should not. I noted no regressions in my own testing.

The patch reverts Gutenberg behavior (specifically a portion of block-library) to a known, working state before #735, which introduced the editableRoot usage for Paragraphs. Later, editableRoot was introduced for List Items as well.

@ellatrix

ellatrix commented Oct 23, 2026 •

Copy link
Copy Markdown

@dcalhoun According to Claude, this should fix the issue: WordPress/gutenberg#85483. The problem seems to be the tab stops and this editor not using the iframe

@dcalhoun

Copy link
Copy Markdown
Member Author

@ellatrix thanks for the note. I followed up in WordPress/gutenberg#85483 (comment).

@crazytonyli I believe we should still try to merge this to while we attempt to fix this upstream in Gutenberg.

@dcalhoun
dcalhoun merged commit e463685 into trunk Oct 26, 2026
41 checks passed
@dcalhoun
dcalhoun deleted the fix/disable-editable-root-ios-caret branch October 26, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants