Skip to content

Commit

Permalink
fix: touch tap to overlay controls (#95)
Browse files Browse the repository at this point in the history
* fix: touch tap to overlay controls

* fix: rename class variable
  • Loading branch information
goshander authored Nov 15, 2023
1 parent 26de0c6 commit cdf5fbc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/GridLayout/GridLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions src/components/OverlayControls/OverlayControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions src/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit cdf5fbc

Please sign in to comment.