Skip to content

Commit a16d992

Browse files
committed
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.
1 parent 9bd7c99 commit a16d992

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

client/modules/IDE/components/Sidebar.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export default function SideBar() {
9494
aria-label={t('Sidebar.AddFolderARIA')}
9595
onClick={() => {
9696
dispatch(newFolder(rootFile.id));
97-
setTimeout(() => dispatch(closeProjectOptions()), 0);
9897
}}
9998
onBlur={onBlurComponent}
10099
>
@@ -106,7 +105,6 @@ export default function SideBar() {
106105
aria-label={t('Sidebar.AddFileARIA')}
107106
onClick={() => {
108107
dispatch(newFile(rootFile.id));
109-
setTimeout(() => dispatch(closeProjectOptions()), 0);
110108
}}
111109
onBlur={onBlurComponent}
112110
>
@@ -119,7 +117,6 @@ export default function SideBar() {
119117
aria-label={t('Sidebar.UploadFileARIA')}
120118
onClick={() => {
121119
dispatch(openUploadFileModal(rootFile.id));
122-
setTimeout(() => dispatch(closeProjectOptions()), 0);
123120
}}
124121
onBlur={onBlurComponent}
125122
>

0 commit comments

Comments
 (0)