Fix drag to select in dropdowns, context menu and action bar (#1704)

- fix drag to select disable at many locations
This commit is contained in:
brendanlaschke
2023-09-21 23:22:13 +02:00
committed by GitHub
parent 043fe3a7ab
commit 54042a7d8f
12 changed files with 23 additions and 35 deletions

View File

@ -1,11 +1,10 @@
import { useRecoilState, useResetRecoilState } from 'recoil';
import { useResetRecoilState } from 'recoil';
import { DropdownButton } from '@/ui/dropdown/components/DropdownButton';
import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope';
import { viewEditModeState } from '@/ui/view-bar/states/viewEditModeState';
import { TableOptionsDropdownId } from '../../constants/TableOptionsDropdownId';
import { isDraggingAndSelectingState } from '../../states/isDraggingAndSelectingState';
import { TableOptionsDropdownButton } from './TableOptionsDropdownButton';
import { TableOptionsDropdownContent } from './TableOptionsDropdownContent';
@ -19,14 +18,6 @@ export const TableOptionsDropdown = ({
}: TableOptionsDropdownProps) => {
const resetViewEditMode = useResetRecoilState(viewEditModeState);
const [, setIsDraggingAndSelecting] = useRecoilState(
isDraggingAndSelectingState,
);
const handleClose = () => setIsDraggingAndSelecting(true);
const handleOpen = () => setIsDraggingAndSelecting(false);
return (
<DropdownButton
buttonComponents={<TableOptionsDropdownButton />}
@ -34,8 +25,6 @@ export const TableOptionsDropdown = ({
dropdownId={TableOptionsDropdownId}
dropdownComponents={<TableOptionsDropdownContent />}
onClickOutside={resetViewEditMode}
onClose={handleClose}
onOpen={handleOpen}
/>
);
};