From a16d992cbe3957333232b7478ca3ef2704ac3f2a Mon Sep 17 00:00:00 2001 From: JATIN Date: Tue, 31 Dec 2024 21:51:58 +0530 Subject: [PATCH] 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 79ffed3b86..9b51af1ac5 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} >