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

Similar UI controls have very inconsistent behavior around defaults #47976

Open
cbirdsong opened this issue Feb 10, 2023 · 1 comment
Open

Similar UI controls have very inconsistent behavior around defaults #47976

cbirdsong opened this issue Feb 10, 2023 · 1 comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended

Comments

@cbirdsong
Copy link

cbirdsong commented Feb 10, 2023

When modifying block settings, there are several distinct ways that controls with similar appearances behave:

1. A group with an explicit "default" or "none" value, which is usually preselected:

An example of this is the block width alignment control is very clear, as it includes an option labeled "none":

CleanShot 2023-02-10 at 09 48 07

2. A group with no option preselected:

Examples include the text align control and vertical alignment control on the columns block, which come with no default value and let you unset their value by clicking on them, allowing you to return to whatever the default is provided by the editor, theme or block style:

CleanShot.2023-02-10.at.11.16.32.mp4
CleanShot.2023-02-10.at.11.18.02.mp4

3. A group with one option preselected without the ability to unset it:

The vertical/horizontal alignment controls on the row block, stack block and buttons block start with one option selected by default, and that cannot be unset:

CleanShot.2023-02-10.at.11.15.56.mp4
CleanShot.2023-02-10.at.11.19.58.mp4

This variant is particularly problematic because it means these blocks sometimes output the corresponding classes/CSS for the default setting, but only if another option has been selected and then changed back to the default. This is inefficient, and also limits the ability for themes to write CSS that contextually modifies defaults while respecting user choices (ex. .is-style-whatever .wp-block-group.is-layout-flex.is-vertical:not([class*="-content-justification"]) {})1


Having these similar controls all behave inconsistently is very confusing in use, and there are other issues that point out similar issues with other controls:

It would be ideal if there was a consistent way to "unset" every control, like Webflow's "reset" function.

Footnotes

  1. The current state of the row/stack blocks requires such nightmarish CSS selectors. 😒 (#44880)

@karmatosed karmatosed added the Needs Testing Needs further testing to be confirmed. label Feb 11, 2023
@ndiego ndiego added Needs Design Feedback Needs general design feedback. and removed Needs Testing Needs further testing to be confirmed. labels Feb 28, 2023
@jordesign jordesign added [Type] Bug An existing feature does not function as intended [Feature] Layout Layout block support, its UI controls, and style output. labels Jul 27, 2023
@hanneslsm
Copy link

Big +1!
For horizontal alignment we have to keep in mind what happens when switching to RTL languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended
5 participants