Bug: Cursor jumps to the end of the document after undo checkbox adding
Cursor jumps to the end of the document after undo checkbox adding. Only reproducible when collaboration mode is on
Lexical version: v0.14.5
Steps To Reproduce
- Launch playground with collaboration mode on
- Add several paragraphs
- Add checkbox in between paragraphs
- Undo
The current behavior
The expected behavior
Cursor stays where undo was done
Similar issues are mentioned in #4846
Also related: #5975 #5974
Hey, I am working on it.
Closed in #6070
It is so similar to my code already pull requested.
Is it ok to copy&paste codes from other pull request already exists?
It's fine if it's allowed by Lexical.js rules. However, I wrote the code in good faith for Lexical's users, so it's a shame that it was copied without mentioning it.
mine https://github.com/facebook/lexical/pull/5975/files#diff-3d291634235852090f5aa491928d6d43fa366302bf0222b0629adf3580e64ab2R549
yours https://github.com/facebook/lexical/pull/6070/files#diff-3d291634235852090f5aa491928d6d43fa366302bf0222b0629adf3580e64ab2R552