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

Remove row in complex tables sometimes provides invalid results #6502

Closed
jodator opened this issue Mar 26, 2020 · 2 comments · Fixed by ckeditor/ckeditor5-table#303
Closed
Assignees
Labels
package:table type:bug This issue reports a buggy (incorrect) behavior.

Comments

@jodator
Copy link
Contributor

jodator commented Mar 26, 2020

Extracted from: ckeditor/ckeditor5-table#286 (comment)

📝 Provide detailed reproduction steps (if any)

Sometimes when the table has complex geometry and you remove a row ( with multiselect or not ), cells are changing their position in table:

26_table1

26_table3

✔️ Expected result

The table geometry should be preserved (ie the cell should stay on the same column)

❌ Actual result

It is randomly pushed in weird positions.


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@jodator jodator added type:bug This issue reports a buggy (incorrect) behavior. package:table labels Mar 26, 2020
@Reinmar Reinmar added this to the iteration 31 milestone Apr 2, 2020
@jodator
Copy link
Contributor Author

jodator commented Apr 3, 2020

This also look like a case for #6439 - to check.

@jodator
Copy link
Contributor Author

jodator commented Apr 9, 2020

The algorithm is wrong 🤷 The order of operations isn't OK. Below is an idea of how this should work:

Steps should be:

  1. Cache all cells that spans over removed rows.
  2. Move all cells from removed rows (and reduce their rowspan) to a row after removed rows. (work on cached table structure from TableWalker).
  3. Remove rows.
  4. Trim cached cells from step 1.

Bonus: fewer operations in multi-row removal.

oleq added a commit to ckeditor/ckeditor5-table that referenced this issue Apr 17, 2020
Fix: Removing rows in complex tables should properly move cells from removed rows. Closes ckeditor/ckeditor5#6502.
mlewand pushed a commit that referenced this issue May 1, 2020
Fix: Removing rows in complex tables should properly move cells from removed rows. Closes #6502.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:table type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants