Skip to content

toggleBulletList/toggleOrderedList creates new list items instead of toggling off when selection includes trailing paragraph #7398

@NagievR

Description

@NagievR

Affected Packages

@tiptap/core @tiptap/extension-bold @tiptap/extension-list @tiptap/extension-text-align @tiptap/extension-text-style @tiptap/html @tiptap/pm @tiptap/react @tiptap/starter-kit

Version(s)

3.15.3

Bug Description

when selecting all content with cmd+a (which includes the trailing empty paragraph with <br class="ProseMirror-trailingBreak">) toggleBulletList()/toggleOrderedList() creates new list items instead of toggling off the list

steps to reproduce

  1. open the editor with lists. for example https://tiptap.dev/product/editor
  2. clear all contnet
  3. type some text e.g. "hello"
  4. click the Bullet List button in the lists dropdown (text becomes a list item)
  5. press cmd+a to select all
  6. do the 4th step to toggle off

when manually selecting only the list content (without trailing paragraph), toggle works correctly

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

toggleBulletList should lift all list items back to paragraphs, not wrap the trailing paragraph into the list (which creates new list items on toggle)

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions