You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spacer block: Fixed width not 1:1 to control value #49941
I've been testing out the newest Spacer block enhancements in #49362 and am running into an oddity with the fixed width. The control value, as a fixed px value, is not exactly depicted as the width applied to the Spacer block.
This is expected behaviour for children of flex blocks.
The initial work to add the child controls in #45364 had flex-shrink: 0 set on fixed width children to prevent this behaviour, but that caused apprehension due to the potential for blocks to break out of their container if the sum of fixed width children were wider than their parent.
I removed the flex-shrink: 0 in #46139, and there hasn't since been a design decision on adding a toggle to opt out of default flex shrinkage. I'd be more than happy to add it, as it enables exciting layout possibilities such as horizontally scrollable containers. We do need some design guidance on the controls for it though.
This is expected behaviour for children of flex blocks.
I'm not quite following? If I set a "fixed" width, shouldn't it have that fixed width as the value? I'm not understanding how 300px wouldn't translated to 300px width.
I'm not quite following? If I set a "fixed" width, shouldn't it have that fixed width as the value?
I was explicitly asked to make the fixed width not fully fixed. The best way to do that was maintaining the default behaviour of flex-basis, which I did in #46139. There's a bit more context in that PR.
Activity
tellthemachines commentedon Apr 20, 2023
This is expected behaviour for children of flex blocks.
The initial work to add the child controls in #45364 had
flex-shrink: 0set on fixed width children to prevent this behaviour, but that caused apprehension due to the potential for blocks to break out of their container if the sum of fixed width children were wider than their parent.I removed the
flex-shrink: 0in #46139, and there hasn't since been a design decision on adding a toggle to opt out of default flex shrinkage. I'd be more than happy to add it, as it enables exciting layout possibilities such as horizontally scrollable containers. We do need some design guidance on the controls for it though.richtabor commentedon Apr 21, 2023
I'm not quite following? If I set a "fixed" width, shouldn't it have that fixed width as the value? I'm not understanding how
300pxwouldn't translated to300pxwidth.tellthemachines commentedon Jan 8, 2024
I was explicitly asked to make the fixed width not fully fixed. The best way to do that was maintaining the default behaviour of
flex-basis, which I did in #46139. There's a bit more context in that PR.