ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
26.35k stars 2.22k forks source link

[Bug]: ListKeymap. Once you break the sequence within a numbered list, it's difficult to continue the sequence. #4379

Open romansp opened 1 year ago

romansp commented 1 year ago

Which packages did you experience the bug in?

list-keymap

What Tiptap version are you using?

2.1.7

What’s the bug you are facing?

This seems like a bug to me but could actually be an expected behavior. Trying to clarify.

Steps to reproduce:

  1. Configure editor to use StarterKit and ListKeymap extensions.
  2. Type in the following list into the document.
  3. 1
  4. 2
  5. 3
  6. 4
  7. 5
  8. 6
  9. Place cursor in the beginning of line 3.
  10. Press Shift-Tab to outdent list. Notice how list splits in two: 4. marker becomes 1.
  11. Press Backspace.

What browser are you using?

Chrome

Code example

https://codesandbox.io/p/sandbox/condescending-thompson-fhjdl7?file=/src/components/Editor.vue

What did you expect to happen?

I expect lists to be joined into a single numbered list and numbering. That's the behavior in editors like Notion and Coda.

1. 1
2. 23
3. 4
4. 5
5. 6

Actual result:

1. 1
2. 23
1. 4
2. 5
3. 6

Anything to add? (optional)

Without list-keymap lists become joined again, essentially reverting back to the original list. But I expect list item 2 to be 2. 23.

1. 1
2. 2
3. 3
4. 4
5. 5
6. 6

Did you update your dependencies?

Are you sponsoring us?

Nantris commented 12 months ago

@romansp would you be willing to close your issue and add your report to #4214 instead? I believe that issue would address the underlying problem. Strength in numbers and all that! This problem (in a different form) has been quite headache for me too.