Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: touch tap to overlay controls #95

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading