Fix TypeError for rows removal for bottom overlay
#11555
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The PR fixes the
TypeErrorthat could occur when removing the row from the bottom overlay. It turned out that there is a more general problem. The issue sits in the overlays table's methods that incorrectly returned the first/last row/column indexes. For example, for the top overlay, when there were no rows rendered (only headers), thegetFirstRenderedRowmethod returned0where it should-1, the same issues I fixed for other overlays.Secondly, after fixing the bug reported by the origin issue, I found another one with the same
TypeErrorand the same scenario (removing a row from the bottom overlay). It's also fixed within PR's changes. In that case, there was a problem with the selection update being in the wrong order compared to thetableMetaupdate.How has this been tested?
I tested the changes locally and I covered the fix with new tests.
Types of changes
Related issue(s):
Affected project(s):
handsontableChecklist: