Skip to content

Commit

Permalink
Fix top layout dropdown overlap (#4048)
Browse files Browse the repository at this point in the history
* Fix SceneSelector dropdown rendering above component

* Fix top layout dropdown overlap
  • Loading branch information
gettinToasty authored Feb 25, 2022
1 parent 0b39e42 commit 224d475
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
11 changes: 9 additions & 2 deletions app/components-react/editor/elements/SceneSelector.m.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
justify-content: flex-end;

> div:last-child {
top: 32px !important;
height: calc(100% - 32px);
top: 44px !important;
height: calc(100% - 44px);
}

:global(.ant-dropdown) {
Expand All @@ -17,6 +17,13 @@
}
}

:global(.no-top-padding) {
.top-container > div:last-child {
top: 32px !important;
height: calc(100% - 32px);
}
}

.active-scene-container {
margin-right: auto;
font-weight: 500;
Expand Down
2 changes: 1 addition & 1 deletion app/components/editor/layouts/Classic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class Classic extends BaseLayout {
style={{ height: `${this.resizes.bar1 * 100}%`, padding: '0 8px' }}
>
{['2', '3', '4'].map(slot => (
<div class={cx(styles.cell, styles.noTopPadding)}>{this.$slots[slot]}</div>
<div class={cx(styles.cell, 'no-top-padding')}>{this.$slots[slot]}</div>
))}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/components/editor/layouts/Default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class Default extends BaseLayout {
style={{ height: `${this.resizes.bar2 * 100}%`, padding: '0 8px' }}
>
{['3', '4', '5'].map(slot => (
<div class={cx(styles.cell, styles.noTopPadding)}>{this.$slots[slot]}</div>
<div class={cx(styles.cell, 'no-top-padding')}>{this.$slots[slot]}</div>
))}
</div>
);
Expand All @@ -53,7 +53,7 @@ export default class Default extends BaseLayout {
/>
<div
style={{ height: `${this.resizes.bar1 * 100}%` }}
class={cx(styles.cell, styles.noTopPadding)}
class={cx(styles.cell, 'no-top-padding')}
>
{this.$slots['2']}
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/components/editor/layouts/FourByFour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export default class FourByFour extends BaseLayout {
reverse={true}
/>
<div class={styles.segmented} style={{ height: `${this.resizes.bar1 * 100}%` }}>
<div class={cx(styles.cell, styles.noTopPadding)}>{this.$slots['2']}</div>
<div class={cx(styles.cell, styles.noTopPadding)}>{this.$slots['3']}</div>
<div class={cx(styles.cell, 'no-top-padding')}>{this.$slots['2']}</div>
<div class={cx(styles.cell, 'no-top-padding')}>{this.$slots['3']}</div>
</div>
<ResizeBar
position="top"
Expand All @@ -56,8 +56,8 @@ export default class FourByFour extends BaseLayout {
class={styles.segmented}
style={{ height: `${this.resizes.bar2 * 100}%`, padding: '0 8px' }}
>
<div class={cx(styles.cell, styles.noTopPadding)}>{this.$slots['4']}</div>
<div class={cx(styles.cell, styles.noTopPadding)}>{this.$slots['5']}</div>
<div class={cx(styles.cell, 'no-top-padding')}>{this.$slots['4']}</div>
<div class={cx(styles.cell, 'no-top-padding')}>{this.$slots['5']}</div>
</div>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions app/components/editor/layouts/Layouts.m.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
width: 100%;
min-width: 0;

&:global(.no-top-padding) {
padding-top: 0;
}

> div {
height: 100%;
display: flex;
Expand All @@ -45,7 +49,3 @@
.side-padded {
.padding-h-sides();
}

.no-top-padding {
padding-top: 0;
}
2 changes: 1 addition & 1 deletion app/components/editor/layouts/Pyramid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class Pyramid extends BaseLayout {
style={{ height: `${this.resizes.bar1 * 100}%`, padding: '0 8px' }}
>
{['2', '3'].map(slot => (
<div class={cx(styles.cell, styles.noTopPadding)}>{this.$slots[slot]}</div>
<div class={cx(styles.cell, 'no-top-padding')}>{this.$slots[slot]}</div>
))}
</div>
</div>
Expand Down

0 comments on commit 224d475

Please sign in to comment.