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]: Selecting text and last image via cursor dont copy image #6038

Closed
1 task done
Gaurussel opened this issue Jan 21, 2025 · 3 comments
Closed
1 task done

[Bug]: Selecting text and last image via cursor dont copy image #6038

Gaurussel opened this issue Jan 21, 2025 · 3 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

@Gaurussel
Copy link

Affected Packages

extension-image

Version(s)

latest

Bug Description

When i select text with image and image is a last node then copied only text (check video)
I suppose this is the case with any block element.

Browser Used

Chrome

Code Example URL

https://tiptap.dev/docs/editor/extensions/nodes/image

Expected Behavior

Image copied width text

Additional Context (Optional)

Screen.Recording.2025-01-21.at.12.35.14.mov

Dependency Updates

  • Yes, I've updated all my dependencies.
@Gaurussel Gaurussel 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 Jan 21, 2025
@nperez0111
Copy link
Contributor

Your selection has to go past the image for it to be included in the selection. Your mouse cursor was inside of the image, therefore it was excluded.

@Gaurussel
Copy link
Author

If the image node is the last one, then there will be no difference between whether the cursor is inside or not.
https://github.com/user-attachments/assets/97852e8f-89ad-46ac-8f71-19939c13cbaa

@nperez0111
Copy link
Contributor

The gapcursor helps with that: https://tiptap.dev/docs/editor/extensions/functionality/gapcursor#page-title

And the trailing node extension will automatically add an empty paragraph after the last node if it is not a paragraph: https://tiptap.dev/docs/examples/experiments/trailing-node

These both will be default installed with the start-kit in Tiptap V3, we couldn't just add them in V2 for backwards-compat

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
None yet
Development

No branches or pull requests

2 participants