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: Fit width should not be available #49937

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

Spacer block: Fit width should not be available #49937

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

In the case of the Spacer block, the "Fit" option doesn't do anything—"fill" and "fixed" should be the only options. We need to find a way to opt a block from displaying "Fit" as a width option. Perhaps it's similar to how a block opts into wide/left/right/center/full alignment?

Note this control is available if the block is within a Row block.

From the PR:

Note: I've made the "Fit" control reset the block width/height to 0 instead of removing it altogether, as removing "Fit" presents a technical challenge, due to those controls not knowing about the blocks they're applied to. I'm not sure if it makes sense to try and hack around this because Spacer is probably the only block that has no intrinsic size.

cc @tellthemachines

Visual

CleanShot.2023-04-19.at.18.47.03.mp4
@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

I wouldn't label this a bug; it was a deliberate decision as the work involved to remove the 'Fit' option would have blown that PR out a fair bit. The control does do something: it sets the size of the Spacer to 0, which, granted, may be unexpected for a "fit" control, but might not be totally useless.

We can look at ways to make the flex controls customisable. The easiest would be via a setting in the blocks they are applied to (potentially any block), but we should be aware that involves adding an extra API, which feels like overkill to tackle an edge case such as this (there can't be many blocks besides Spacer that have no intrinsic size). I'll have a think and see if I can come up with anything else.

@richtabor
Copy link
Member Author

The control does do something: it sets the size of the Spacer to 0, which, granted, may be unexpected for a "fit" control, but might not be totally useless.

How would a 0px wide Spacer block be useful?

The easiest would be via a setting in the blocks they are applied to (potentially any block), but we should be aware that involves adding an extra API, which feels like overkill to tackle an edge case such as this (there can't be many blocks besides Spacer that have no intrinsic size).

It's important to reduce the snags folks will certainly hit. Fit, Fill and Fixed are already confusing—having one of the three that makes the block effectively disappear just adds to the confusion.

@richtabor
Copy link
Member Author

I'll have a think and see if I can come up with anything else.

Much appreciated! ❤️

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