diff --git a/src/components/GridLayout/GridLayout.js b/src/components/GridLayout/GridLayout.js index 6881326..a10f6c7 100644 --- a/src/components/GridLayout/GridLayout.js +++ b/src/components/GridLayout/GridLayout.js @@ -2,6 +2,7 @@ import React from 'react'; import ReactGridLayout, {WidthProvider} from 'react-grid-layout'; import GridItem from '../GridItem/GridItem'; import {DashKitContext} from '../../context/DashKitContext'; +import {OVERLAY_CONTROLS_CLASS_NAME} from '../../constants'; const Layout = WidthProvider(ReactGridLayout); // eslint-disable-line new-cap @@ -122,6 +123,7 @@ export default class GridLayout extends React.PureComponent { {...(draggableHandleClassName ? {draggableHandle: `.${draggableHandleClassName}`} : null)} + draggableCancel={`.${OVERLAY_CONTROLS_CLASS_NAME}`} > {config.items.map((item, i) => { return ( diff --git a/src/components/OverlayControls/OverlayControls.tsx b/src/components/OverlayControls/OverlayControls.tsx index 08af9c4..c122256 100644 --- a/src/components/OverlayControls/OverlayControls.tsx +++ b/src/components/OverlayControls/OverlayControls.tsx @@ -12,7 +12,7 @@ import { IconProps, MenuItemProps, } from '@gravity-ui/uikit'; -import {COPIED_WIDGET_STORE_KEY, MenuItems} from '../../constants'; +import {COPIED_WIDGET_STORE_KEY, OVERLAY_CONTROLS_CLASS_NAME, MenuItems} from '../../constants'; import {ConfigLayout, ConfigItem, PluginBase, StringParams, Config, ItemState} from '../../shared'; import type {RegisterManager} from '../../utils/register-manager'; import {DotsIcon} from '../../icons/DotsIcon'; @@ -23,7 +23,7 @@ import {cn} from '../../utils/cn'; import './OverlayControls.scss'; import {Settings} from '../../typings'; -const b = cn('dashkit-overlay-controls'); +const b = cn(OVERLAY_CONTROLS_CLASS_NAME); export enum OverlayControlsPosition { TopRight = 'top_right', diff --git a/src/constants/common.ts b/src/constants/common.ts index d5c1df0..21b6e63 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -2,6 +2,8 @@ export const COPIED_WIDGET_STORE_KEY = 'dashCopiedItem'; export const DEFAULT_NAMESPACE = 'default'; +export const OVERLAY_CONTROLS_CLASS_NAME = 'dashkit-overlay-controls'; + export const MenuItems = { Copy: 'copy', Delete: 'delete',