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]: Wrong cursor position after using undo and redo #5910

Open
1 task done
bbonczek opened this issue Dec 3, 2024 · 1 comment
Open
1 task done

[Bug]: Wrong cursor position after using undo and redo #5910

bbonczek opened this issue Dec 3, 2024 · 1 comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@bbonczek
Copy link

bbonczek commented Dec 3, 2024

Affected Packages

core (?)

Version(s)

2.10.2

Bug Description

After using redo and undo, cursor position is wrong.

To reproduce:

  1. Go to Tiptap's demo page
  2. Focus editor
  3. Type 'aaa'
  4. Wait a second
  5. type 'tt'
  6. Press ctrl + z to undo
    image
  7. Press ctrl + y to redo
    image

Cursor is position is like this: aaa|tt. I'd expect it to be at aaatt|

cinnamon-2024-12-03T113945+0100.webm

Browser Used

Chrome

Code Example URL

https://templates.tiptap.dev/

Expected Behavior

Cursor position should update after redo.

Additional Context (Optional)

It seems to work correctly in ProseMirror: https://prosemirror.net/examples/basic/

Dependency Updates

  • Yes, I've updated all my dependencies.
@bbonczek bbonczek added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Dec 3, 2024
@github-project-automation github-project-automation bot moved this to Triage open in Tiptap Dec 3, 2024
@nperez0111
Copy link
Contributor

This is reproducible in the y-prosemirror demo: https://demos.yjs.dev/prosemirror/prosemirror.html

It is to do with how y-prosemirror restores the selection, somewhere around here: https://github.com/yjs/y-prosemirror/blob/7b0a65c20eea7f7da535aef9e08d336c0e07cd24/src/plugins/undo-plugin.js#L86-L89

Is being tracked here: yjs/y-prosemirror#38 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
No open projects
Status: Triage open
Development

No branches or pull requests

2 participants