-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Popovers are broken when shown in a contextmenu
event listener
#10905
Comments
Perhaps the light dismiss behavior should be tweaked to not close any popovers that are shown immediately before in |
Maybe wrap it in a |
That doesn't work in Chrome, FF or Safari. Once you increase the timeout to at least 100ms, then it sometimes works. But at that point you start to have a noticeable delay. |
Ah, interesting. I just tested it, the reason is because To test this, try wrapping the What's also interesting is it doesn't seem that the "close popovers on click/mouseup" can be canceled. At least no combination that I tried with canceling click/mouseup/pointerup resulted in canceling the popover close. So that doesn't seem like a viable option either.
|
Found a workaround by using document.querySelector('span')?.addEventListener('contextmenu', (event) => {
event.preventDefault();
});
document.querySelector('span')?.addEventListener('mouseup', (event) => {
if (event.which === 3 || event.ctrlKey) {
document.querySelector('[popover]').showPopover();
}
}); No |
What is the issue with the HTML Standard?
https://codepen.io/jpzwarte/pen/OPLQypz?editors=1010
If you want to use a popover for a context menu, you cannot use the
contextmenu
event to display the popover. The problem is that the popover is immediately light dismissed.(not sure if this belongs in whatwg/html or whatwg/dom)
The text was updated successfully, but these errors were encountered: