lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: Cursor jumps to the end of the document after undo checkbox adding

Open KatsiarynaDzibrova opened this issue 1 year ago • 3 comments

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

  1. Launch playground with collaboration mode on
  2. Add several paragraphs
  3. Add checkbox in between paragraphs
  4. Undo

The current behavior

checkbox-cursor

The expected behavior

Cursor stays where undo was done

KatsiarynaDzibrova avatar May 02 '24 14:05 KatsiarynaDzibrova

Similar issues are mentioned in #4846

KatsiarynaDzibrova avatar May 02 '24 16:05 KatsiarynaDzibrova

Also related: #5975 #5974

StyleT avatar May 02 '24 21:05 StyleT

Hey, I am working on it.

CARPEDIEM05 avatar May 03 '24 11:05 CARPEDIEM05

Closed in #6070

StyleT avatar May 13 '24 16:05 StyleT

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

matsuyama-k1 avatar May 15 '24 09:05 matsuyama-k1