Skip to content

Commit

Permalink
fix ProjectOptions closes issue processing#3303
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jatin24062005 committed Dec 31, 2024
1 parent 9bd7c99 commit a16d992
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions client/modules/IDE/components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export default function SideBar() {
aria-label={t('Sidebar.AddFolderARIA')}
onClick={() => {
dispatch(newFolder(rootFile.id));
setTimeout(() => dispatch(closeProjectOptions()), 0);
}}
onBlur={onBlurComponent}
>
Expand All @@ -106,7 +105,6 @@ export default function SideBar() {
aria-label={t('Sidebar.AddFileARIA')}
onClick={() => {
dispatch(newFile(rootFile.id));
setTimeout(() => dispatch(closeProjectOptions()), 0);
}}
onBlur={onBlurComponent}
>
Expand All @@ -119,7 +117,6 @@ export default function SideBar() {
aria-label={t('Sidebar.UploadFileARIA')}
onClick={() => {
dispatch(openUploadFileModal(rootFile.id));
setTimeout(() => dispatch(closeProjectOptions()), 0);
}}
onBlur={onBlurComponent}
>
Expand Down

0 comments on commit a16d992

Please sign in to comment.