Skip to content

Commit

Permalink
fix(dashboards): Ensure text card draggability (PostHog#24859)
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes authored Sep 9, 2024
1 parent 2d89685 commit f3b6bc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frontend/src/scenes/dashboard/DashboardItems.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
will-change: width, height;
}

.react-grid-item.react-draggable .CardMeta {
// .CardMeta is the draggable handle
.react-grid-item.react-draggable .CardMeta,
.react-grid-item.react-draggable .TextCard__body {
// .CardMeta is the draggable handle of insight cards. Text cards are draggable as a whole
cursor: move;
user-select: none; // Prevent accidental text selection while dragging
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/dashboard/DashboardItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function DashboardItems(): JSX.Element {
<ReactGridLayout
width={gridWrapperWidth}
className={className}
draggableHandle=".CardMeta"
draggableHandle=".CardMeta,.TextCard__body"
isDraggable={dashboardMode === DashboardMode.Edit}
isResizable={dashboardMode === DashboardMode.Edit}
layouts={layouts}
Expand Down

0 comments on commit f3b6bc4

Please sign in to comment.