Skip to content

The open alternative to Salesforce, designed for AI.

[Dashboards] fix dragging widget z index (#17371)

nitin873749981bd8
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx
index a85fb01ca77..3dfa794ccc9 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx
@@ -7,6 +7,7 @@ import {
PAGE_LAYOUT_CONFIG,
type PageLayoutBreakpoint,
} from '@/page-layout/constants/PageLayoutBreakpoints';
+import { PAGE_LAYOUT_GRID_ITEM_DRAGGING_Z_INDEX } from '@/page-layout/constants/PageLayoutGridItemDraggingZIndex';
import { PAGE_LAYOUT_GRID_ITEM_Z_INDEX } from '@/page-layout/constants/PageLayoutGridItemZIndex';
import { PAGE_LAYOUT_GRID_MARGIN } from '@/page-layout/constants/PageLayoutGridMargin';
import { PAGE_LAYOUT_GRID_ROW_HEIGHT } from '@/page-layout/constants/PageLayoutGridRowHeight';
@@ -59,6 +60,10 @@ const StyledGridContainer = styled.div`
z-index: ${PAGE_LAYOUT_GRID_ITEM_Z_INDEX};
}
+ .react-grid-item.react-draggable-dragging {
+ z-index: ${PAGE_LAYOUT_GRID_ITEM_DRAGGING_Z_INDEX};
+ }
+
.react-grid-item:hover .widget-card-resize-handle {
display: block !important;
}
diff --git a/packages/twenty-front/src/modules/page-layout/constants/PageLayoutGridItemDraggingZIndex.ts b/packages/twenty-front/src/modules/page-layout/constants/PageLayoutGridItemDraggingZIndex.ts
new file mode 100644
index 00000000000..0ac1def51b6
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/constants/PageLayoutGridItemDraggingZIndex.ts
@@ -0,0 +1 @@
+export const PAGE_LAYOUT_GRID_ITEM_DRAGGING_Z_INDEX = 3;