Skip to content

Commit 10fc677

Browse files
tyxlaellatrixdcalhoun
authored
Rich text: restore contenteditable on pointercancel (#82598)
* Rich text: restore contenteditable on pointercancel `preventFocusCapture` sets `contenteditable` to `false` on `pointerdown` and restores it on `pointerup`. On touch devices a touch that turns into a scroll fires `pointercancel` instead of `pointerup`, so the attribute is never restored and the text block stays uneditable. Listen for `pointercancel` as well, using the same handler. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iXbFmYveRx2xsN3G6WfML * Add a CHANGELOG entry Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iXbFmYveRx2xsN3G6WfML --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: dcalhoun <dpcalhoun@git.wordpress.org>
1 parent aa5b9a2 commit 10fc677

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎packages/rich-text/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Export the `RichTextFormat` type, describing a single format applied to a range of characters within a `RichTextValue` ([#79486](https://github.com/WordPress/gutenberg/pull/79486)).
88

9+
### Bug Fixes
10+
11+
- Restore a rich text element's `contenteditable` attribute when a pointer interaction ends with `pointercancel`, so that swipe scrolling on touch devices no longer leaves text blocks uneditable ([#82598](https://github.com/WordPress/gutenberg/pull/82598)).
12+
913
## 7.54.0 (2026-08-26)
1014

1115
## 7.53.0 (2026-08-12)

‎packages/rich-text/src/hook/event-listeners/prevent-focus-capture.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ export function preventFocusCapture() {
4949
'pointerup',
5050
onPointerUp
5151
);
52+
const unsubscribePointerCancel = subscribeDelegatedListener(
53+
defaultView,
54+
'pointercancel',
55+
onPointerUp
56+
);
5257
return () => {
5358
unsubscribePointerDown();
5459
unsubscribePointerUp();
60+
unsubscribePointerCancel();
5561
};
5662
};
5763
}

0 commit comments

Comments
 (0)