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

The class "is-horizontal" is not added on front when row block (variation) is placed directly. #43665

Open
Humanify-nl opened this issue Aug 27, 2022 · 2 comments
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Type] Enhancement A suggestion for improvement.

Comments

@Humanify-nl
Copy link

Humanify-nl commented Aug 27, 2022

Description

I am super happy with the addition of the group classnames: is-horizontal or is-vertical for the variations, but they are not yet consistent.

When placing a Row block directly these classes do not get added on the front end. Only when the layout/orientation 'vertical' is triggered, and then set back to 'horizontal', it will get added to the block in the front end.

Step-by-step reproduction instructions

  1. Add a Row block by typing /row OR by selecting a few blocks and making them into a Row.
  2. Update page.
  3. Load the front. No 'is-horizontal' class on the block.
  4. Go back to edit page.
  5. Select the Row block and tick 'vertical' on in layout.orientation block settings panel, and switch it to 'horizontal' again (no need to update page in between).
  6. Update page.
  7. Load the front. Now there is a 'is-horizontal' class on the block.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPres 6.0.1
  • No Gutenberg

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@t-hamano t-hamano added the [Block] Group Affects the Group Block (and row, stack and grid variants) label Aug 28, 2022
@andrewserong andrewserong added the [Type] Enhancement A suggestion for improvement. label Aug 30, 2022
@andrewserong
Copy link
Contributor

Tested and confirmed that the default horizontal orientation is not output as a classname by the Layout block support (around this line). It looks like we'll need to add a conditional for the Flex layout type to ensure that the default values have their respective classnames output both in the editor and on the site frontend.

@Humanify-nl
Copy link
Author

Humanify-nl commented Sep 14, 2022

There is a weird bug here.

I tried to fix this temporarily by adding a overriding block variation to add a class for it. This also doesn’t work anymore. But used to in 6.0. (Maybe this helps to identify it)

I’d say it is a pretty high priority bug if editor and front-end have such a discrepancy on WordPress core release. Every row will not work properly. How did this sneak through?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants