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] Cursor bug after deleting a paragraph before/after a table. #420

Closed
ajboni opened this issue Apr 16, 2024 · 4 comments
Closed

[BUG] Cursor bug after deleting a paragraph before/after a table. #420

ajboni opened this issue Apr 16, 2024 · 4 comments
Labels
bug Something isn't working released

Comments

@ajboni
Copy link

ajboni commented Apr 16, 2024

Hi, this is a bit hard to explain, if you open the demo at https://mdxeditor.dev/editor/demo and replace the content with this table:

| 1 | 2 | 3 |
| - | - | - |
| a | b | c |
| e | e | f |

then go back to editing mode and delete the empty paragraph after the table. The user is unable to enter text either before or after the table. in this particular example, they cannot edit the document any more.

image

Workarounds

Inerting an image or a link

@ajboni ajboni added the bug Something isn't working label Apr 16, 2024
@ajboni ajboni changed the title [BUG] Cursor bug after deleting last paragraph before/after a table. [BUG] Cursor bug after deleting a paragraph before/after a table. Apr 16, 2024
@petyosi
Copy link
Contributor

petyosi commented Apr 18, 2024

@ajboni that's a fair point, but I have no definitive idea on how to address this in an elegant way. One approach would be to always keep a paragraph at the bottom, if the last node is a decorator (table, code block, etc). This should be doable with Lexical. I will think about this.

Copy link

🎉 This issue has been resolved in version 2.20.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@petyosi
Copy link
Contributor

petyosi commented Apr 19, 2024

I have done something here, for the "after" part. The before part is not so trivial, I'm afraid. Google docs seems to always keep a paragraph above the table, for example.

@ajboni
Copy link
Author

ajboni commented Apr 19, 2024

Works great! I think the "after" part is the most common case, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants