[BUG] Fix positioning of table footer rows when rows are of varying heights #837
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.
The
TableStickyPolyfill
is used to position header and footer rows. The individualth
andtd
offset positions are calculated for the footer rows so they remain “sticky”. There is a bug in the logic for calculating the bottom offset for table footer rows where therows
were being iterated backwards while theheights
were iterated forwards. This bug manifests when table footer rows have varying heights and the list of heights is not a palindrome.As shown in the image below, the table has 7 footer rows where the height of the 1st footer row is 74px and the height of all other footer rows is 26px. The bottom offset of the 6th row takes into account the height of the 1st row and not the 7th row due to the loop iteration direction bug.
The list
heights: [74, 26, 26, 26, 26, 26, 26]
is errantly being read in reverse order asheights: [26, 26, 26, 26, 26, 26, 74]
.The ember-twiddle demonstrates the issue here.