Bug: CollaborationPlugin's initialState can be undoed
- Dominant language
- TypeScript
- Stars
- 23.9k
- Forks
- 2.2k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 55
Description
It seems that if initialState is given to CollaborationPlugin and client didnt receive any content when syncing with backend it adds initialState to the editorState. Problem is that this initialState to editorState addition also creates new row to undoManager's undoStack and therefore can be undoed. It kinda feels strange to be able to undo initialState off.
Also as far as i know, this works differently compared to normal initialState of editor (without collab) where initialState is not part of the history stack and therefore cant be undoed.
It's kinda annoying in my own case where I give certain node layout to initialState. This layout shouldnt be edited in any way, but now user can still press undo and remove it completly. I have made patch file in my project to add clearHistory call after initialState has been set, but of course this would be better if it was supported by library itself.
Lexical version: 0.23.1
## The current behavior
CollaborationPlugin's initialState can be undoed
## The expected behavior
CollaborationPlugin's initialState should not be able to be undoed
Contributor guide
Assessment
This issue has not been assessed yet.