Skip to content

[CRAFTING] fix(rich-text-web): discard the typed value when pressing escape - #2458

Closed
samuelreichert wants to merge 1 commit into
mainfrom
fix/rich-text-config-escape-draft
Closed

samuelreichert wants to merge 1 commit into
mainfrom
fix/rich-text-config-escape-draft

Conversation

@samuelreichert

@samuelreichert samuelreichert commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Pull request type

Bug fix (non-breaking change which fixes an issue)


Description

In a configuration dropdown field (for example, the table configuration), pressing Escape saved the typed value instead of discarding it.

Root cause: Escape called clearDraft() (a state update) and then blur() straight away. onBlur ran before the update applied and committed the draft.

Fix: a ref set around the Escape-triggered blur makes onBlur skip the commit.

The change was written test-first: the new regression test failed before the fix. Lint and the full package test suite pass, and there is a CHANGELOG entry under [Unreleased].

Based on main (rebased after #2453 was merged).

What should be covered while testing?

  1. Open a table configuration dropdown and type a new value in a number field.
  2. Press Escape. The value goes back to what it was, and the table is unchanged.
  3. Type a value and press Enter. It is applied, as before.

🤖 Generated with Claude Code

@samuelreichert
samuelreichert requested a review from a team as a code owner October 6, 2026 13:55
@samuelreichert
samuelreichert force-pushed the test/rich-text-unit-coverage branch from be0a685 to a153c39 Compare October 12, 2026 09:11
Base automatically changed from test/rich-text-unit-coverage to main October 12, 2026 11:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@samuelreichert

Copy link
Copy Markdown
Contributor Author

Superseded by #2495, which combines this fix with the other Rich Text fixes on top of the latest main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant