diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 19a5e00188..6b04b8b00e 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -11204,6 +11204,17 @@ class App extends React.Component { return [actionCopy, ...options]; } + const zIndexActions: ContextMenuItems = + this.state.stylesPanelMode === "full" + ? [ + CONTEXT_MENU_SEPARATOR, + actionSendBackward, + actionBringForward, + actionSendToBack, + actionBringToFront, + ] + : []; + return [ CONTEXT_MENU_SEPARATOR, actionCut, @@ -11229,11 +11240,7 @@ class App extends React.Component { actionUngroup, CONTEXT_MENU_SEPARATOR, actionAddToLibrary, - CONTEXT_MENU_SEPARATOR, - actionSendBackward, - actionBringForward, - actionSendToBack, - actionBringToFront, + ...zIndexActions, CONTEXT_MENU_SEPARATOR, actionFlipHorizontal, actionFlipVertical, diff --git a/packages/excalidraw/components/ContextMenu.scss b/packages/excalidraw/components/ContextMenu.scss index 3bedf2ba7a..0b370d919b 100644 --- a/packages/excalidraw/components/ContextMenu.scss +++ b/packages/excalidraw/components/ContextMenu.scss @@ -1,6 +1,10 @@ @import "../css/variables.module.scss"; .excalidraw { + .context-menu-popover { + z-index: var(--zIndex-ui-context-menu); + } + .context-menu { position: relative; border-radius: 4px; diff --git a/packages/excalidraw/components/ContextMenu.tsx b/packages/excalidraw/components/ContextMenu.tsx index 3295d1d099..4cef2bb177 100644 --- a/packages/excalidraw/components/ContextMenu.tsx +++ b/packages/excalidraw/components/ContextMenu.tsx @@ -64,6 +64,7 @@ export const ContextMenu = React.memo( offsetTop={appState.offsetTop} viewportWidth={appState.width} viewportHeight={appState.height} + className="context-menu-popover" >