Fix context menu overlay click
This commit is contained in:
parent
984b04ab40
commit
1fdd69924b
@ -185,6 +185,12 @@ export function openBtnMenu(menuElement: HTMLElement, onClose?: () => void) {
|
|||||||
window.addEventListener('contextmenu', onClick, {once: true});
|
window.addEventListener('contextmenu', onClick, {once: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ! because this event must be canceled, and can't cancel on menu click (below)
|
||||||
|
overlay.addEventListener(CLICK_EVENT_NAME, (e) => {
|
||||||
|
cancelEvent(e);
|
||||||
|
onClick(e);
|
||||||
|
});
|
||||||
|
|
||||||
// ! safari iOS doesn't handle window click event on overlay, idk why
|
// ! safari iOS doesn't handle window click event on overlay, idk why
|
||||||
document.addEventListener(CLICK_EVENT_NAME, onClick);
|
document.addEventListener(CLICK_EVENT_NAME, onClick);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user