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

Make the modal layer let click events passthrough #760

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Speedphoenix
Copy link
Contributor

This adds the useModal option, defaults to true for the existing behaviour.

With useModal set to false, rather than creating a hidden layer behind the contextmenu to capture closing clicks, uses document.addeventlistener in capture mode.

This allows for propagating click events when clicking in empty space to close the contextmenu (before, only the mousedown event was propagated, and no click was sent since the following mouseup would not be on the same element)

Note useModal = false might break on older browsers, or some features might not work with it anymore (unlikely though).

With useModal set to false, uses document.addeventlistener in capture
mode rather than an invisible layer.
Note that this probably breaks on older browsers, and some features or
options might not work anymore.

useModal is set to true by default, and should behave just like before.
@Speedphoenix Speedphoenix changed the title Make the contextmenu let click events passthrough Make the modal layer let click events passthrough Jan 13, 2022
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.

None yet

1 participant