Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacer block: Fixed width not 1:1 to control value #49941

Open
richtabor opened this issue Apr 19, 2023 · 3 comments
Open

Spacer block: Fixed width not 1:1 to control value #49941

richtabor opened this issue Apr 19, 2023 · 3 comments
Labels
[Block] Spacer Affects the Spacer Block [Type] Bug An existing feature does not function as intended

Comments

@richtabor
Copy link
Member

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.

The same occurs when dragging to resize:

CleanShot.2023-04-19.at.18.54.13.mp4

cc @tellthemachines

@richtabor richtabor added [Type] Bug An existing feature does not function as intended [Block] Spacer Affects the Spacer Block labels Apr 19, 2023
@tellthemachines
Copy link
Contributor

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.

@richtabor
Copy link
Member Author

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.

@tellthemachines
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Spacer Affects the Spacer Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants