From a16d992cbe3957333232b7478ca3ef2704ac3f2a Mon Sep 17 00:00:00 2001 From: JATIN Date: Tue, 31 Dec 2024 21:51:58 +0530 Subject: [PATCH 1/2] fix ProjectOptions closes issue #3303 The issue stemmed from the use of a setTimeout in the onBlur handler that closed the project options too quickly. Specifically, the setTimeout(() => dispatch(closeProjectOptions()), 0) was causing the options to close even if the user had not finished interacting with the menu. This was particularly problematic with trackpad input, where the timing of the events could be misinterpreted. --- client/modules/IDE/components/Sidebar.jsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/modules/IDE/components/Sidebar.jsx b/client/modules/IDE/components/Sidebar.jsx index 79ffed3b8..9b51af1ac 100644 --- a/client/modules/IDE/components/Sidebar.jsx +++ b/client/modules/IDE/components/Sidebar.jsx @@ -94,7 +94,6 @@ export default function SideBar() { aria-label={t('Sidebar.AddFolderARIA')} onClick={() => { dispatch(newFolder(rootFile.id)); - setTimeout(() => dispatch(closeProjectOptions()), 0); }} onBlur={onBlurComponent} > @@ -106,7 +105,6 @@ export default function SideBar() { aria-label={t('Sidebar.AddFileARIA')} onClick={() => { dispatch(newFile(rootFile.id)); - setTimeout(() => dispatch(closeProjectOptions()), 0); }} onBlur={onBlurComponent} > @@ -119,7 +117,6 @@ export default function SideBar() { aria-label={t('Sidebar.UploadFileARIA')} onClick={() => { dispatch(openUploadFileModal(rootFile.id)); - setTimeout(() => dispatch(closeProjectOptions()), 0); }} onBlur={onBlurComponent} > From e5ee1ccb6b2d7357dd1b7e9ae5d453f253547ea6 Mon Sep 17 00:00:00 2001 From: JATIN Date: Tue, 31 Dec 2024 21:58:19 +0530 Subject: [PATCH 2/2] fix issue#3303 ProjectOptions closes The issue stemmed from the use of a setTimeout in the onBlur handler that closed the project options too quickly. Specifically, the setTimeout(() => dispatch(closeProjectOptions()), 0) was causing the options to close even if the user had not finished interacting with the menu. This was particularly problematic with trackpad input, where the timing of the events could be misinterpreted. --- client/modules/IDE/components/Sidebar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/modules/IDE/components/Sidebar.jsx b/client/modules/IDE/components/Sidebar.jsx index 9b51af1ac..21fb23a3b 100644 --- a/client/modules/IDE/components/Sidebar.jsx +++ b/client/modules/IDE/components/Sidebar.jsx @@ -131,4 +131,4 @@ export default function SideBar() { ); -} +} \ No newline at end of file