Skip to content

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

Open

Description

@richtabor

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

Activity

  1. added
    [Type] Bug
    [Block] Spacer
    on Apr 19, 2023
  2. tellthemachines commented on Apr 20, 2023

    @tellthemachines
    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.

  3. richtabor commented on Apr 21, 2023

    @richtabor
    MemberAuthor

    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.

  4. tellthemachines commented on Jan 8, 2024

    @tellthemachines
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Spacer[Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions