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

history.cutoff() not properly cutting off user-typed text if an empty deletion is made at the end of the Quill state #4190

Open
jcayabyab opened this issue May 8, 2024 · 0 comments · May be fixed by #4195

Comments

@jcayabyab
Copy link

jcayabyab commented May 8, 2024

Encountered when creating an autocomplete system for Quill. The key here is this line: editor.deleteText(editor.getLength() - 1, 0), which deletes nothing at the end of the state. If this line is commented out, the cutoff() line works as expected.

Steps for Reproduction

  1. Visit minimal JSFiddle: https://jsfiddle.net/gpvtdxrc/3/
  2. Type some text, e.g., "test" , then press "Insert"
  3. Press undo
  4. Notice that the typed text also gets deleted

Video reproduction:

Edit.fiddle.-.JSFiddle.-.Code.Playground.-.8.May.2024.mp4

Expected behavior: The typed text is preserved

Actual behavior: The typed text is deleted

Platforms: MacOS Sonoma 14.4.1, Chrome 123.0.6312.124 (arm64)

Version: 2.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants