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

Selection is incorrectly restored in some multi-cell scenarios #7659

Closed
scofalik opened this issue Jul 21, 2020 · 0 comments · Fixed by #7662
Closed

Selection is incorrectly restored in some multi-cell scenarios #7659

scofalik opened this issue Jul 21, 2020 · 0 comments · Fixed by #7662
Labels
package:table type:bug This issue reports a buggy (incorrect) behavior.

Comments

@scofalik
Copy link
Contributor

📝 Provide detailed reproduction steps (if any)

Selection fixing, that happens when a selection range goes to the graveyard, works a bit incorrectly at this moment. The algorithm tries to fix every selection range that gets removed. Consider this scenario:

[ ][ ][ ]
[x][x][ ]
[x][x][ ]

This is a 3x3 table, with cells marked with x being selected.

Now, when you remove the second row, you'd expect this result:

[ ][ ][ ]
[x][x][ ]

The second row is removed and the selection stays on those cells that are still in the content. However, the actual result is this:

[ ][ ][x]
[x][x][ ]

Why? Well, two selection ranges were removed and got fixed to select the cell in the upper-right corner.

This happens because the selection post-fixer does not check the selection state. I propose to fix this algorithm. Selection range should be fixed only if it is the last range of the selection. In other cases, we should leave the selection as is.

@scofalik scofalik added type:bug This issue reports a buggy (incorrect) behavior. package:table labels Jul 21, 2020
niegowski added a commit that referenced this issue Jul 22, 2020
Fix (engine): Fixed incorrect selection fixing in some multi-cell selection scenarios. Closes #7659.
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.

1 participant