Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: CollaborationPlugin's initialState can be undoed #7110

Open
teroko opened this issue Jan 29, 2025 · 0 comments
Open

Bug: CollaborationPlugin's initialState can be undoed #7110

teroko opened this issue Jan 29, 2025 · 0 comments
Labels
collab Related to Lexical collaboration features

Comments

@teroko
Copy link

teroko commented Jan 29, 2025

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

@etrepum etrepum added the collab Related to Lexical collaboration features label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collab Related to Lexical collaboration features
Projects
None yet
Development

No branches or pull requests

2 participants