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: Nested table rows are appended to parent tables when exporting DOM #6749

Open
aleksandr-lapushkin opened this issue Oct 21, 2024 · 3 comments
Labels
tables Relates to Lexical Tables

Comments

@aleksandr-lapushkin
Copy link
Contributor

Lexical version: 0.18.0

Steps To Reproduce

  1. Go to Playground
  2. Insert a 2x2 table
  3. Insert another 2x2 table in any cell.
  4. Export DOM
Screen.Recording.2024-10-21.at.10.56.39.mov

Link to faulty code:

const cols = tableElement.querySelectorAll('col');

The current behavior

  1. The exported DOM has two tables
  2. The outer table has 4 columns and 4 rows
  3. The nested table has no rows

The expected behavior

  1. The exported DOM has two tables
  2. The outer table has 2 columns and 2 rows
  3. The nested table has 2 rows and 2 columns

Impact of fix

Tables cannot be reliably used until this is fixed.

@etrepum etrepum added the tables Relates to Lexical Tables label Oct 21, 2024
@noahnu
Copy link

noahnu commented Oct 21, 2024

I can confirm this works in Lexical 0.17.1 but is broken in 0.18.0.

@etrepum
Copy link
Collaborator

etrepum commented Nov 5, 2024

I don't think that nested tables are currently well supported, I'm sure there are a number of related edge cases. If you are interested in this feature I suggest that you look into contributing PRs to implement better tests and support for them.

@noahnu
Copy link

noahnu commented Nov 5, 2024

I don't think that nested tables are currently well supported, I'm sure there are a number of related edge cases. If you are interested in this feature I suggest that you look into contributing PRs to implement better tests and support for them.

FWIW, I've been using nested tables extensively for the past few versions. We haven't had any issues with edge cases until this particular issue. I'd be happy to contribute some test coverage + fixes if @aleksandr-lapushkin doesn't get to it first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tables Relates to Lexical Tables
Projects
None yet
Development

No branches or pull requests

3 participants