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]: selectAll causes an unexpected newline when pasting #6165

Open
1 task done
hustle-dev opened this issue Mar 7, 2025 · 0 comments
Open
1 task done

[Bug]: selectAll causes an unexpected newline when pasting #6165

hustle-dev opened this issue Mar 7, 2025 · 0 comments
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

@hustle-dev
Copy link

hustle-dev commented Mar 7, 2025

Affected Packages

core

Version(s)

2.11.0

Bug Description

When using the selectAll command and pasting content, an unexpected newline is inserted. This seems to be caused by the selectAll implementation, which sets the selection to AllSelection but does not handle the paste behavior properly.

Steps to Reproduce:

  1. Execute editor.commands.selectAll().
  2. Copy the selected content.
  3. Paste the content back into the editor.
  4. Notice that an unintended newline appears.
2025-03-07.17.00.58.mov

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

The pasted content should replace the selection without inserting an extra newline.

2025-03-07.17.02.54.mov

This is a tiptap example that works with code from the 2.10.4 version.

Additional Context (Optional)

The issue might stem from how AllSelection interacts with the transaction when pasting. It could be necessary to handle paste events explicitly or adjust the selection behavior.

This looks like an issue with the merged PRs and issues below.

#5900
#5516

Image

Dependency Updates

  • Yes, I've updated all my dependencies.
@hustle-dev hustle-dev 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 Mar 7, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Tiptap: Issues Mar 7, 2025
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
Status: Needs Triage
Development

No branches or pull requests

1 participant