Repository navigation
fix: removed table rows keep their layout while animating out (#7) - #260
Merged
Merged
Conversation
An absolutely positioned <tr> loses table layout, so its cells collapsed to their content and (in Firefox) the row jumped down. The leaving row now renders as its own fixed-layout table with each cell pinned to its measured width, border-spacing compensated, and is lined up on its first cell. Cell styles are restored on cleanup.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…lugins alone, restore only pinned cell styles, anchor on pre-removal position
Member
Author
|
Independent review found 4 edge cases, all fixed with regression tests that fail on the previous commit:
table-row-layout: 21/21 across Chromium/Firefox/WebKit. Full e2e green. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #7.
A leaving element is set to
position: absoluteso it can fade out in place. For a<tr>that drops table layout: cells collapse to their content (195px → 46px in the test), and in Firefox the row also jumped 28px down. The animated-out row looked like it "floated outside the table".For table rows only (
display: table-row):display: table; table-layout: fixedwith each cell pinned to its measured width (box-sizing: border-box)border-collapse/border-spacing, offsetting the spacing so cells don't shiftOther elements are untouched (one extra
getComputedStyleper removal to detect rows).Tests: new
table-row-layout.spec.tscovers separate + 4px spacing,collapse, and separate +10px 2pxspacing. In every case, every cell of the leaving row stays within ±2px (±4px width) of its original box, and cell styles are cleared after. 9/9 pass on Chromium, Firefox and WebKit; the test fails on master. Full e2e: 115 passed, 8 skipped.