mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 08:20:45 -05:00
🐛 Fix submenu positioning in context menu
This commit is contained in:
parent
b999057be1
commit
440495a1d0
3 changed files with 23 additions and 20 deletions
|
@ -652,16 +652,15 @@
|
|||
|
||||
[:& dropdown {:show (boolean mdata)
|
||||
:on-close #(st/emit! dw/hide-context-menu)}
|
||||
[:ul {:class (stl/css :workspace-context-menu)
|
||||
:ref dropdown-ref
|
||||
:style {:top top :left left}
|
||||
: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}])]]))
|
||||
|
||||
[:div {:class (stl/css :workspace-context-menu)
|
||||
:ref dropdown-ref
|
||||
:style {:top top :left left}
|
||||
:on-context-menu prevent-default}
|
||||
|
||||
[: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}])]]]))
|
||||
|
|
|
@ -6,24 +6,30 @@
|
|||
|
||||
@import "refactor/common-refactor.scss";
|
||||
|
||||
.workspace-context-menu,
|
||||
.workspace-context-submenu {
|
||||
@include menuShadow;
|
||||
.workspace-context-menu {
|
||||
position: absolute;
|
||||
top: $s-40;
|
||||
left: $s-736;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
z-index: $z-index-4;
|
||||
}
|
||||
|
||||
.context-list,
|
||||
.workspace-context-submenu {
|
||||
@include menuShadow;
|
||||
display: grid;
|
||||
width: $s-240;
|
||||
padding: $s-4;
|
||||
border-radius: $br-8;
|
||||
border: $s-2 solid var(--panel-border-color);
|
||||
background-color: var(--menu-background-color);
|
||||
z-index: $z-index-4;
|
||||
max-height: 100vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.workspace-context-submenu {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.separator {
|
||||
height: $s-12;
|
||||
}
|
||||
|
|
|
@ -58,5 +58,3 @@
|
|||
stroke: var(--pathbar-icon-color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue