From e7b5baa49a30de1d8aec4d3f7bde0331a125dfdf Mon Sep 17 00:00:00 2001 From: Ary Neto Date: Tue, 26 Nov 2024 18:44:32 -0700 Subject: [PATCH] fix: file picker opening on delete --- .../features/app-settings/panel/project-panel/ProjectData.tsx | 4 +++- apps/client/src/features/editors/finder/Finder.tsx | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/client/src/features/app-settings/panel/project-panel/ProjectData.tsx b/apps/client/src/features/app-settings/panel/project-panel/ProjectData.tsx index d3a0e2baf..960ceb218 100644 --- a/apps/client/src/features/app-settings/panel/project-panel/ProjectData.tsx +++ b/apps/client/src/features/app-settings/panel/project-panel/ProjectData.tsx @@ -68,7 +68,9 @@ export default function ProjectData() { uploadInputRef.current?.click(); }; - const handleDeleteLogo = () => { + const handleDeleteLogo = (e: React.MouseEvent) => { + e.preventDefault(); + e.stopPropagation(); setValue('projectLogo', null, { shouldDirty: true, }); diff --git a/apps/client/src/features/editors/finder/Finder.tsx b/apps/client/src/features/editors/finder/Finder.tsx index 2a8f9e3fb..ddec44e5d 100644 --- a/apps/client/src/features/editors/finder/Finder.tsx +++ b/apps/client/src/features/editors/finder/Finder.tsx @@ -1,6 +1,6 @@ import { KeyboardEvent, useState } from 'react'; import { Input, Modal, ModalBody, ModalContent, ModalFooter, ModalOverlay } from '@chakra-ui/react'; -import { useDebouncedCallback } from '@mantine/hooks'; +import { useDebounceCallback } from '@mantine/hooks'; import { isOntimeEvent, SupportedEvent } from 'ontime-types'; import { useEventSelection } from '../../rundown/useEventSelection'; @@ -20,7 +20,7 @@ export default function Finder(props: FinderProps) { const [selected, setSelected] = useState(0); const setSelectedEvents = useEventSelection((state) => state.setSelectedEvents); - const debouncedFind = useDebouncedCallback(find, 100); + const debouncedFind = useDebounceCallback(find, 100); const navigate = (event: KeyboardEvent) => { // all operations need results