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:
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
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 viaselectionchangeand 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:
Task 2 — Remove the workaround
Once Press This's minimum required WordPress version includes the upstream fix, remove the workaround.
Requires at least: 6.9(readme.txt,press-this-plugin.php)When the minimum bumps to 7.1+:
src/components/LinkEscapeFix.jssrc/components/PressThisEditor.jsRelated: #116, #118