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]: Pasting editor content starting with a list-item back into the same editor does not preserve list-markers when nodes are marked as defining #5908

Open
1 task done
Shamoyeeta 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

@Shamoyeeta
Copy link

Shamoyeeta commented Dec 3, 2024

Affected Packages

core, extension-paragraph, extension-bullet-list, extension-ordered-list

Version(s)

latest (2.10.3)

Bug Description

When multiple nodes are declared as defining, specifically paragraph and list nodes, and we have some content created in the editor itself where the starting node is a list item, if the content is copied from the editor and pasted back into the same editor, the first list item is not preserved. The first node becomes a paragraph instead, and any sub-lists of the first node become lists at the level of the first node, thus incorrectly changing the hierarchy of the nested list.

Browser Used

Issue is visible in all browsers.

Code Example URL

https://codesandbox.io/p/sandbox/keen-wave-7xykrl

Expected Behavior

When both paragraph and list nodes are declared as defining, it should preserve the first list node while pasting back the content into the editor instead of transforming it into a paragraph node. The nested lists should also maintain their original hierarchy.

Additional Context (Optional)

Adding an GIF of the same:
Animation

Dependency Updates

  • Yes, I've updated all my dependencies.
@Shamoyeeta Shamoyeeta 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

We just handoff to Prosemirror in this scenario, so I think you would have to take this upstream: https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext

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