-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Table Overflow in Lexical #8036
Comments
I have no faith that option 2 will ever materialize, and even then I don't think it would be the best option. A DecoratorNode would introduce quite a bit of complexity (nested editors, new boundaries in the selection, problems with the undo manager, etc.). I think the best thing to do would be to add a We could easily force the schema in a backwards-compatible way using lexical transforms. If the Lexical team agrees with the solution and is interested, I will implement it in their repository, if not, I will do it in ours. What do you think, @AlessioGr? |
…rflow). (#8431) This is a half-baked and temporary solution to #8036 As I said there: - ideally tables would have a horizontal scroll independent of the rest of the document, just like Notion does. - the solution in this PR can make the experience of resizing columns frustrating However, despite that drawback, it is arguably a better behavior than the current one where they can have overflow over the editor container. Until the ideal solution is implemented, let's default to this behavior. ## Before ![image](https://github.com/user-attachments/assets/b2856a3f-4b43-45f0-a7db-00c53fe5c980) ## After ![image](https://github.com/user-attachments/assets/2f60d186-d614-4c72-968c-137820812e11)
Should we close this @GermanJablo ? |
not yet. The linked PR is a temporary solution. But I'm campaigning to finish this soon |
Link to reproduction
https://github.com/payloadcms/payload
Environment Info
Describe the Bug
Incorrect behaviors
Having tables overflow is a mistake, as their content can conflict with other elements of the interface, as is now happening in Payload.
Another incorrect behavior is the one that occurs in the Lexical Playground, where if the table is too large, the entire editor becomes larger. The horizontal scroll bar is not placed over the table, but over the entire content.
A half-way solution
A super quick way to fix overflow is to add a max-width of 100% to the table.
The problem is, as this user noted, that this creates conflicts with the column width property.
This is what OneNote does and I've always hated it. Sometimes columns resize in a magical or hard-to-understand way. It's better to give the user the flexibility to adjust column widths to their liking and to have overflow if needed.
The correct solution
The correct solution to this is for tables to have an overflow scroll independent of the rest of the editor, similar to what Notion does:
The problem is that the
<table>
tag doesn't support overflow: scroll. A div is needed to wrap it.There is an issue opened on Lexical with recent movement about this Issue: facebook/lexical#6480
The solution will have to be:
Reproduction Steps
It can be reproduced anywhere with a Lexical editor. But the problem is more evident when there is a field with a sidebar position as in the image, since the elements overlap.
Adapters and Plugins
No response
The text was updated successfully, but these errors were encountered: