You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
31.0.0
What operating system are you using?
Windows
Operating System Version
Windows 11
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
The provided GIST outlines the following use-cases:
Use-case (1) Works as expected on all platforms
A user left-clicks (mouse down & up) on a HTML element.
The element sends a message to the main process to show a context menu via Menu.popup().
The user can interact with the shown Menu, or click outside of the menu to have the Menu disappear.
Actual Behavior
Use-case (2) Does not work as expected on Windows and Linux
A user left-clicks (mouse down only) on a HTML element, and while holding the left mouse button, moves the mouse.
At the moment of the "down" event, the main process shows a context menu via Menu.popup().
As the user is moving the mouse with the left mouse button pressed, he can interact with the shown Menu.
If the user thereafter releases the left mouse button outside of the Menu (i.e. not on a MenuItem):
a. MacOS: The Menu disappears. This is the desired behavior.
b. Windows & Linux: The Menu remains. Furthermore, the mouse "up" events are swallowed, so it is not possible to programmatically handle this edge case in the user code, thus making it impossible to hide the Menu upon the user releasing the left mouse button in this use-case.
I speculate that the PointerUp/MouseUp events are swallowed when the Menu is shown, because the Menu is outside the WebContents. Propagating the PointerUp/MouseUp events to the WebContents while a Menu is shown seems to be a tall order.
A simpler approach could be to change the behavior of the context menu in Windows and Linux such that the context menu is automatically closed when a user releases the mouse click as is described in use-case (2).
The text was updated successfully, but these errors were encountered:
I believe I've created this bug in error. After investigating the default behavior of use-case (2) in Windows and Linux, I've realized that leaving the Menu shown after release of the mouse button is expected.
Preflight Checklist
Electron Version
31.0.0
What operating system are you using?
Windows
Operating System Version
Windows 11
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
The provided GIST outlines the following use-cases:
Use-case (1) Works as expected on all platforms
Menu.popup()
.Menu
, or click outside of the menu to have theMenu
disappear.Actual Behavior
Use-case (2) Does not work as expected on Windows and Linux
Menu.popup()
.Menu
.Menu
(i.e. not on aMenuItem
):a. MacOS: The
Menu
disappears. This is the desired behavior.b. Windows & Linux: The
Menu
remains. Furthermore, the mouse "up" events are swallowed, so it is not possible to programmatically handle this edge case in the user code, thus making it impossible to hide theMenu
upon the user releasing the left mouse button in this use-case.Testcase Gist URL
https://gist.github.com/safris/ef48974847e38b91a7a302b13d47eb44
Additional Information
I speculate that the
PointerUp
/MouseUp
events are swallowed when theMenu
is shown, because theMenu
is outside theWebContents
. Propagating thePointerUp
/MouseUp
events to theWebContents
while aMenu
is shown seems to be a tall order.A simpler approach could be to change the behavior of the context menu in Windows and Linux such that the context menu is automatically closed when a user releases the mouse click as is described in use-case (2).
The text was updated successfully, but these errors were encountered: