2 Commits

Author SHA1 Message Date
Andrey Antukh
9b03307f33 🐛 Clear stale blur selections safely
Clear blur entities even when the editor selection is stale, while
preserving undo history, focus and safe selections for undo and redo.

Align the Draft.js test runner with frontend Vitest and repair the
lockfile so frozen dependency installation succeeds.

AI-assisted-by: gpt-6.1-terra
2026-11-26 16:46:33 +00:00
Andrey Antukh
c6c742ff84 🐛 Guard blur-selection entity against stale text selections
Skip the PENPOT_SELECTION stamp when the selection is collapsed
or points at blocks that no longer exist: blurring the editor
rebuilds the EditorState with fresh block keys while a delayed
on-change still carries the old keys, which crashed Draft.js
reading getCharacterList of undefined and killed the workspace.

Harden the sibling helpers (removeBlurSelectionEntity,
cursorToEnd, select-all/end builders) the same way and add a
vitest suite to the draft-js package covering stale, empty,
and collapsed selections.

Closes #11667

AI-assisted-by: muse-spark-1.3-contributor
2026-11-26 17:18:24 +01:00