Skip to content

Verify link-escape workaround coexists with upstream Gutenberg fix; remove once min WP includes it #154

Description

@kraftbj

Background

PR #118 added src/components/LinkEscapeFix.js, a DOM-level workaround for #116: pressing Escape to close the link popover (Ctrl+K / Cmd+K) caused the caret to jump to position 0. The workaround tracks the caret offset via selectionchange and restores it after the popover closes.

The root cause lived upstream in @wordpress/rich-text. An upstream fix has now landed in Gutenberg:

Task 1 — Confirm coexistence

Verify that the #118 workaround and the upstream fix do not conflict when both are present (i.e. running Press This against a WordPress build / Gutenberg that already includes WordPress/gutenberg#80396).

The workaround was designed to be a harmless no-op once upstream is fixed (it restores the caret to offset N when it is already at N), but this should be confirmed in practice:

  • Link + Escape via Ctrl+K / Cmd+K keeps the caret at the end of the linked text (no jump to 0)
  • Same via the toolbar Link button
  • Escape without entering a URL does not move the caret
  • No double-restoration, flicker, or caret misplacement introduced by the two fixes running together

Task 2 — Remove the workaround

Once Press This's minimum required WordPress version includes the upstream fix, remove the workaround.

  • Current minimum: Requires at least: 6.9 (readme.txt, press-this-plugin.php)
  • Upstream fix ships in: WP 7.1 (via Gutenberg 23.7)

When the minimum bumps to 7.1+:

Related: #116, #118

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions