PanelChrome: Allow panel to be dragged if set as draggable from the outside (#61698)

This commit is contained in:
Alexa V
2023-01-23 10:38:38 +00:00
committed by GitHub
parent e32cd6d4ff
commit db51e963de
4 changed files with 23 additions and 9 deletions

View File

@@ -240,6 +240,7 @@ export class DashboardGrid extends PureComponent<Props, State> {
cols={GRID_COLUMN_COUNT}
rowHeight={GRID_CELL_HEIGHT}
draggableHandle=".grid-drag-handle"
draggableCancel=".grid-drag-cancel"
layout={this.buildLayout()}
onDragStop={this.onDragStop}
onResize={this.onResize}

View File

@@ -636,6 +636,8 @@ export class PanelStateWrapper extends PureComponent<Props, State> {
const title = panel.getDisplayTitle();
const padding: PanelPadding = plugin.noPadding ? 'none' : 'md';
const dragClass = !(isViewing || isEditing) ? 'grid-drag-handle' : '';
const titleItems = [
<PanelHeaderTitleItems
key="title-items"
@@ -674,6 +676,8 @@ export class PanelStateWrapper extends PureComponent<Props, State> {
description={!!panel.description ? this.onShowPanelDescription : undefined}
titleItems={titleItems}
menu={menu}
dragClass={dragClass}
dragClassCancel="grid-drag-cancel"
padding={padding}
>
{(innerWidth, innerHeight) => (