Description
In the Plain Text example, replacing a dragged partial text selection and then pressing Cmd+Z does not restore the full original selected text locally. The live reference restores the selected text correctly.
This is separate from the full Cmd+A replacement undo issue because this reproduction uses a normal partial text selection inside one paragraph.
Recording
Screenshots attached below:
Local actual behavior:
Live reference expected behavior:
Video attached below:
[optional; screenshots should be enough unless the drag-select/type/undo sequence is unclear]
Sandbox
No standalone sandbox. Reproduced in the Slate examples site.
Local reproduction URL:
http://localhost:3100/examples/plaintext
Reference URL:
https://www.slatejs.org/examples/plaintext
Additional confirmed scope:
This issue is not limited to the original Plain Text reproduction. The same partial-selection replacement undo problem has now been reproduced across multiple Slate examples, including:
examples/plaintext
examples/inlines
examples/styling
examples/code-highlighting
In each case, selecting part of the editor text, typing replacement text, and pressing Cmd+Z does not fully restore the original selected text locally. The live reference restores the selected text correctly.
In examples/inlines, selecting links, typing URLs, then pressing Cmd+Z leaves localhost as There are two ways to add U...; selecting existing link text hyperlink, typing wiki, then pressing Cmd+Z leaves localhost link text as w. The live reference restores the original selected text in both checks.
In examples/styling, selecting the word using, typing changed, then pressing Cmd+Z leaves localhost with only c restored in place of the selected word. The live reference restores using.
Styling steps checked:
- Open
http://localhost:3100/examples/styling.
- Select the word
using in either styled editor.
- Type
changed.
- Press
Cmd+Z.
- Compare with
https://www.slatejs.org/examples/styling.
Steps
To reproduce the behavior:
- Go to
http://localhost:3100/examples/plaintext.
- Drag-select the word
plain , including the trailing space, from the sentence This is editable plain text, just like a <textarea>!.
- Type
simple.
- Press
Cmd+Z.
- Repeat the same steps on
https://www.slatejs.org/examples/plaintext.
Expectation
After pressing Cmd+Z, the editor should restore the original text:
This is editable plain text, just like a <textarea>!
Actual behavior
On localhost, after pressing Cmd+Z, the original selected text is not restored. The editor becomes:
This is editable stext, just like a <textarea>!
The live reference restores the original plain selection.
Environment
- Local URL:
http://localhost:3100/examples/plaintext
- Reference URL:
https://www.slatejs.org/examples/plaintext
- Local branch/commit:
v2, ce2bd6c6
- Browser: Chrome
- OS: macOS
- Local app setup: Slate examples site served locally with
bun serve
Impact
This breaks a normal text editing undo workflow. Replacing a partial text selection and undoing can leave corrupted text locally instead of restoring the original selected text.
Description
In the Plain Text example, replacing a dragged partial text selection and then pressing
Cmd+Zdoes not restore the full original selected text locally. The live reference restores the selected text correctly.This is separate from the full
Cmd+Areplacement undo issue because this reproduction uses a normal partial text selection inside one paragraph.Recording
Screenshots attached below:
Local actual behavior:
Live reference expected behavior:
Video attached below:
[optional; screenshots should be enough unless the drag-select/type/undo sequence is unclear]
Sandbox
No standalone sandbox. Reproduced in the Slate examples site.
Local reproduction URL:
http://localhost:3100/examples/plaintextReference URL:
https://www.slatejs.org/examples/plaintextAdditional confirmed scope:
This issue is not limited to the original Plain Text reproduction. The same partial-selection replacement undo problem has now been reproduced across multiple Slate examples, including:
examples/plaintextexamples/inlinesexamples/stylingexamples/code-highlightingIn each case, selecting part of the editor text, typing replacement text, and pressing
Cmd+Zdoes not fully restore the original selected text locally. The live reference restores the selected text correctly.In
examples/inlines, selectinglinks, typingURLs, then pressingCmd+Zleaves localhost asThere are two ways to add U...; selecting existing link texthyperlink, typingwiki, then pressingCmd+Zleaves localhost link text asw. The live reference restores the original selected text in both checks.In
examples/styling, selecting the wordusing, typingchanged, then pressingCmd+Zleaves localhost with onlycrestored in place of the selected word. The live reference restoresusing.Styling steps checked:
http://localhost:3100/examples/styling.usingin either styled editor.changed.Cmd+Z.https://www.slatejs.org/examples/styling.Steps
To reproduce the behavior:
http://localhost:3100/examples/plaintext.plain, including the trailing space, from the sentenceThis is editable plain text, just like a <textarea>!.simple.Cmd+Z.https://www.slatejs.org/examples/plaintext.Expectation
After pressing
Cmd+Z, the editor should restore the original text:Actual behavior
On localhost, after pressing
Cmd+Z, the original selected text is not restored. The editor becomes:The live reference restores the original
plainselection.Environment
http://localhost:3100/examples/plaintexthttps://www.slatejs.org/examples/plaintextv2,ce2bd6c6bun serveImpact
This breaks a normal text editing undo workflow. Replacing a partial text selection and undoing can leave corrupted text locally instead of restoring the original selected text.