Skip to content

1183 component height#1185

Merged
pngwn merged 3 commits into
mainfrom
1183-component-height
May 7, 2022
Merged

1183 component height#1185
pngwn merged 3 commits into
mainfrom
1183-component-height

Conversation

@pngwn
Copy link
Copy Markdown
Member

@pngwn pngwn commented May 7, 2022

This was more involved that I thought it would be. Closes #1183. Closes #1184.

Notes for #1183

In #1165 we changed some flex behaviour but this didn't work in all contexts, most notably it forced everything to grow regardless of its parent. This worked well for one case but broke some others (including the default interface layout).

Most components are now aware of their parent and selectively apply flex-1.

I've also made some other tweaks as I found a few additional bugs when fixing this, all relating to layout.

Interface

before Screenshot 2022-05-07 at 10 16 38
after Screenshot 2022-05-07 at 13 45 39

Custom Layout

before Screenshot 2022-05-07 at 12 26 04
after Screenshot 2022-05-07 at 11 42 42

Notes for #1184

We had some custom logic to detect when form components were adjacent to one another, removing spacing and top + bottom border radiuses where necessary. However, this logic assumed that form elements always appeared in a column (one on top of the other). Side-by-side form elements also applied the exact same logic leading to very broken layouts. With the above change making components aware of their parent, we can easily change the layout behaviour depending on whether the parent is a column or a row.

  • If adjacent forms are in a column, they will be grouped 'stacked' (one on top of the other with top and bottom border radiuses modified).
    • if adjacent forms are in a row, they will grouped alongside one another with left + right border radiuses modified.

We might need to modify this if we change how layouts work.

before Screenshot 2022-05-07 at 14 05 27
after Screenshot 2022-05-07 at 14 06 39

@pngwn
Copy link
Copy Markdown
Member Author

pngwn commented May 7, 2022

Oh, @gary149, yet another use case for container queries. This was actually very annoying to implement.

@pngwn pngwn requested review from abidlabs, aliabid94 and gary149 May 7, 2022 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

form groups broken when in a row Components getting cut off vertically

2 participants