bug: Right-click context menu does not close when clicking outside (unlike file dropdown menu)
p5.js version
1.11.10
What is your operating system?
Windows
Web browser and version
Brave : 1.83.118 Chromium: 141.0.7390.108 (Official Build) (64-bit)
Actual Behavior
When interacting with the file explorer in the p5.js Web Editor, the dropdown menu (triggered by clicking the down-arrow next to a file) correctly closes when the user clicks anywhere outside of it.
However, the right-click context menu behaves inconsistently. After right-clicking on a file to open the context menu, clicking elsewhere on the page does not close the menu. It remains on screen until a manual action is taken (e.g., selecting an option or reloading).
This creates an inconsistent UX and may cause confusion, especially since the dropdown and context menus are expected to behave similarly.
Expected Behavior
The right-click context menu should close automatically when clicking outside of it, consistent with the behavior of the file dropdown (down-arrow button).
Steps to reproduce
Steps:
- Open the p5.js Web Editor.
- In the file explorer, right-click on any file.
- A context menu appears.
- Click anywhere outside of the context menu.
- Observe that the menu does not close.
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
@Himanshu-9977 I can work on this issue can you assign me this?
@Himanshu-9977 Hi, Can you share the screen for the issue, I checked it out and it is working fine.
Hi @Himanshu-9977, I would be happy to work on a fix. Please let me know if I can be assigned to this.
@yugalkaushik I agree it is working fine with me also.
@Himanshu-9977 I guess the issue causing from the browser
@piyushzingade @yugalkaushik Not really sure, if it's browser. But, it doesn't work still after so many days on my desk.
https://github.com/user-attachments/assets/2a79bc5f-779f-4cce-ac22-695bdf15adfc
@Himanshu-9977, have you tried on different browser??
@Himanshu-9977 Hi himanshu, It can be some browser glitch, can you try it on some other browser.
@piyushzingade I tried in Microsoft Edge as well. The problem persists for me.