Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jatin issue#3303 #3314

Merged
merged 6 commits into from
Mar 4, 2025
Merged

Jatin issue#3303 #3314

merged 6 commits into from
Mar 4, 2025

Conversation

Jatin24062005
Copy link
Contributor

Fixes #3303

Changes:
Removed of the setTimeout(() => dispatch(closeProjectOptions()), 0); allows the project options to remain open without prematurely closing when interacting with the menu, especially when using trackpads.
I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

Jatin24062005 and others added 4 commits December 31, 2024 21:51
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.
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.
@Jatin24062005
Copy link
Contributor Author

@raclim, I fixed the test issues. Sorry for these— it is my old pull request, and I didn't focus on checking the tests earlier.

Copy link
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look into this!

I think the fix here might not be the best approach, as we probably want to keep setTimeout() to prevent the menu options from closing too soon and to ensure that the project options close after the action has been complete.

In the original issue, it links to another PR that probably was the cause, so I think trying to reset some of its changes and investing from there could be a start! I'm thinking that one approach could be to implement a useEffect() to handle open and closing the dropdown when the state of projectOptionsVisible changes, rather than using onBlur and onFocus to resolve both this issue and the one where the project options dropdown doesn't close when a user clicks outside of it.

@Jatin24062005
Copy link
Contributor Author

@raclim i tried you Approach and it is actually much better than the OnBlur and Onfocus method Please review these again... ugh : )

Copy link
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update on this, I'm glad that it seems to work! I removed the extra comment and added back in the onContextMenu prop just to try to keep the same behavior, but feel free to provide any additional comments on it if you feel otherwise!

@raclim raclim merged commit c942a62 into processing:develop Mar 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ProjectOptions closes before option can activate.
2 participants