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

Layout: Stack block loses its flex-direction style after changing its child layout #55249

Closed
jsnajdr opened this issue Oct 11, 2023 · 1 comment · Fixed by #55291
Closed

Layout: Stack block loses its flex-direction style after changing its child layout #55249

jsnajdr opened this issue Oct 11, 2023 · 1 comment · Fixed by #55291
Assignees
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@jsnajdr
Copy link
Member

jsnajdr commented Oct 11, 2023

Steps to reproduce:
Create a flex layout with a row + stack + two items structure:

<!-- wp:group {"layout":{"type":"flex"}} -->
  <div class="wp-block-group">
    <!-- wp:group {"layout":{"type":"flex","orientation":"vertical"}} -->
      <div class="wp-block-group">
        <!-- wp:paragraph -->
          <p>First row</p>
        <!-- /wp:paragraph -->
        <!-- wp:paragraph -->
          <p>Second row</p>
        <!-- /wp:paragraph -->
      </div>
    <!-- /wp:group -->
  </div>
<!-- /wp:group -->

It is displayed in the editor like this, with the paragraph item laid out in a column:

Screenshot 2023-10-11 at 12 58 32

Now select the Stack group, and go to its Styles / Dimensions / Width settings:

Screenshot 2023-10-11 at 13 01 04

Here change "Fit" to "Fill". And then change back to "Fit" (because you don't like the change).

After switching to "Fill" the Stack block's items are suddenly aligned horizonally and they stay horizonal even after you change back to "Fit":

Screenshot 2023-10-11 at 12 59 39

My layout is still broken even though I returned back to the original "Fit" option. The only way how to get the original back is Undo or page reload.

The horizonal alignment is caused by the fact that the Stack block originally has a flex-direction: column style:

Screenshot 2023-10-11 at 13 02 57

but that style disappears after switching to "Fill". And is not re-added after returning to "Fit".

@jordesign jordesign changed the title Stack block loses its flex-direction style after changing its child layout Layout: Stack block loses its flex-direction style after changing its child layout Oct 11, 2023
@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. [Feature] Layout Layout block support, its UI controls, and style output. labels Oct 11, 2023
@tellthemachines
Copy link
Contributor

tellthemachines commented Oct 12, 2023

I can reproduce this in 6.4 as well as Gutenberg trunk. Looking into it now

Edit: looks to have been caused by #54466

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. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants