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

Delay opening context menu to support windows again #5756

Merged
merged 4 commits into from
Oct 6, 2021

Conversation

MichaelBuessemeyer
Copy link
Contributor

Windows behaves very strangely when it comes to the context menu. The same right-click to open the context menu also somehow reaches the overlay of the context menu, although the context menu isn't even rendered by React at this moment. Additionally, this occurs on all browsers on windows and on no other operating system. The browsers under windows I tested were: Firefox, Chrome, and Opera.

To prevent this weird behaviour I delayed the state change, which causes the context menu to render. This circumvents the behaviour for all tested windows browsers and the code still works on Linux + firefox for me.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Open a hybrid tracing.
  • Play around with the context menu, it should open and close as expected.
  • Once the dev instance is up, please also test on a windows browser.

Issues:

  • none

@fm3
Copy link
Member

fm3 commented Oct 5, 2021

Great find!
Quick question: would it work with timeout 0 as well, or does the bug occur again then?

@MichaelBuessemeyer
Copy link
Contributor Author

MichaelBuessemeyer commented Oct 5, 2021

Quick question: would it work with timeout 0 as well, or does the bug occur again then?

Yeah 0 ms works too. Thanks for the suggestion. This is a bit cleaner than 1.
I also tested it with my browsers on windows and it works fine.

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Great that you found a workaround for this 🎉 🎉 🎉 On linux, everything works as before in chrome and firefox for me, too 🆗

@bulldozer-boy bulldozer-boy bot merged commit 2f751a7 into master Oct 6, 2021
@bulldozer-boy bulldozer-boy bot deleted the fix-context-menu-windows branch October 6, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants