0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 00:19:07 -05:00

🐛 Fix submenu positioning in context menu

This commit is contained in:
Eva Marco 2024-03-15 17:27:51 +01:00
parent b999057be1
commit 440495a1d0
3 changed files with 23 additions and 20 deletions

View file

@ -652,16 +652,15 @@
[:& dropdown {:show (boolean mdata) [:& dropdown {:show (boolean mdata)
:on-close #(st/emit! dw/hide-context-menu)} :on-close #(st/emit! dw/hide-context-menu)}
[:ul {:class (stl/css :workspace-context-menu) [:div {:class (stl/css :workspace-context-menu)
:ref dropdown-ref :ref dropdown-ref
:style {:top top :left left} :style {:top top :left left}
:on-context-menu prevent-default} :on-context-menu prevent-default}
(case (:kind mdata)
:shape [:& shape-context-menu {:mdata mdata}]
:page [:& page-item-context-menu {:mdata mdata}]
:grid-track [:& grid-track-context-menu {:mdata mdata}]
:grid-cells [:& grid-cells-context-menu {:mdata mdata}]
[:& viewport-context-menu {:mdata mdata}])]]))
[:ul {:class (stl/css :context-list)}
(case (:kind mdata)
:shape [:& shape-context-menu {:mdata mdata}]
:page [:& page-item-context-menu {:mdata mdata}]
:grid-track [:& grid-track-context-menu {:mdata mdata}]
:grid-cells [:& grid-cells-context-menu {:mdata mdata}]
[:& viewport-context-menu {:mdata mdata}])]]]))

View file

@ -6,24 +6,30 @@
@import "refactor/common-refactor.scss"; @import "refactor/common-refactor.scss";
.workspace-context-menu, .workspace-context-menu {
.workspace-context-submenu {
@include menuShadow;
position: absolute; position: absolute;
top: $s-40; top: $s-40;
left: $s-736; left: $s-736;
display: flex; z-index: $z-index-4;
flex-direction: column; }
.context-list,
.workspace-context-submenu {
@include menuShadow;
display: grid;
width: $s-240; width: $s-240;
padding: $s-4; padding: $s-4;
border-radius: $br-8; border-radius: $br-8;
border: $s-2 solid var(--panel-border-color); border: $s-2 solid var(--panel-border-color);
background-color: var(--menu-background-color); background-color: var(--menu-background-color);
z-index: $z-index-4;
max-height: 100vh; max-height: 100vh;
overflow-y: auto; overflow-y: auto;
} }
.workspace-context-submenu {
position: absolute;
}
.separator { .separator {
height: $s-12; height: $s-12;
} }

View file

@ -58,5 +58,3 @@
stroke: var(--pathbar-icon-color); stroke: var(--pathbar-icon-color);
} }
} }