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]: Dropping text in front of a table produces a broken, empty table #6074

Open
1 task done
mr1name opened this issue Jan 31, 2025 · 1 comment
Open
1 task done
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

@mr1name
Copy link

mr1name commented Jan 31, 2025

Affected Packages

core

Version(s)

Any version released in the last year (at least)

Bug Description

When dropping text, prosemirror attempts to calculate the insert position via posAtCoords. In this case, it uses the element's bounding box. So if the cursor gets there, rather than adjusting the position, it assumes that the insertion occurs at the depth level of the table rows and looks for suitable neighbors for the new element and finds tableRow.

A table that is created in this way is invisible and broken. It cannot be deleted via Backspace (throws error), properly selected, etc. To reproduce it, you can just go to the example from the tiptap website

There are many places where it is possible to handle this case both in prosemirror modules and outside the prosemirror logic, although it should probably be considered as a bug of prosemirror itself.

Screen.Recording.2025-01-31.at.11.10.42.mov

Browser Used

Chrome

Code Example URL

https://tiptap.dev/docs/examples/basics/tables

Expected Behavior

The text is inserted before the table and no new tables are created.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@mr1name mr1name 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 31, 2025
@mr1name
Copy link
Author

mr1name commented Jan 31, 2025

Also created an issue in the prosemirror repository:
ProseMirror/prosemirror#1506

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

1 participant