Repository navigation
CUI-70: stop an overflowing row crushing the injected table columns to zero width - #1248
Draft
JeanMarcMilletScality wants to merge 1 commit into
Draft
JeanMarcMilletScality wants to merge 1 commit into
JeanMarcMilletScality wants to merge 1 commit into
Conversation
Contributor
Hello jeanmarcmilletscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
This branch has not been 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.
TL;DR — A table row with no room left shrank its checkbox and dropped-columns cells to zero width instead of overflowing, so those cells' controls were painted outside themselves, over the neighbouring column.
Context / Why
useDroppedColumnsanduseCheckboxeach append a synthetic column and size it throughcellStylewith a barewidth. A row is a flex container andbodyCellStyleresets every cell tomin-width: 0, so a cell with a width and noflexcomputes toflex: 0 1 autowith an automatic minimum of zero — the only cell in the row the layout can shrink without limit, and the first it takes space from.The consumer's own columns therefore keep their declared widths while the injected one collapses. In the new story the reveal cell measures 3px at a 320px container and 23px at 340, against the 60px it declares, and its button paints across the neighbouring cell. The checkbox column carries the same declaration, which puts row selection in the same position.
🧩 Approach
Each cell now holds the width it declares.
flex: 0 0 Npxis what the barewidthalready meant; the shrink factor was the accident.🔍 Review focus
dropAton one more column, which stays the consumer's call. What this fixes is the box model: the cell is the width it says it is, and the overflow is now visible rather than hidden inside a collapsed cell.🧪 How to test
npm run storybook, open Components / Data Display / Table › Reveal trigger in a row with no room left.Last NameandAgedrop out, leaving a floored name column, a fixed-width actions column and the reveal trigger — a row that cannot fit.60px,flex: 0 0 60px. Ondevelopment/1.0the same cell measures 23px and its+2button is painted outside it, reaching back over theEditcell.No before/after screenshot: in the band where the cell is crushed the two states look alike, because the button is painted outside its cell either way. The difference is the cell's computed width, so the check above is the one that shows it.
The existing Responsive column drop with reveal story cannot show any of this — all its columns are zero-basis flex, so its rows never overflow. That is why the new story declares a
minWidthon the name column and a fixed-width actions column.🔗 References