Enable context actions on input fields, partly fix of #204

This commit is contained in:
Pieter Vander Vennet 2021-05-11 00:40:16 +02:00
parent 6396492773
commit 1f0b20f5d4
2 changed files with 7 additions and 1 deletions

View file

@ -143,6 +143,12 @@ if (layoutFromBase64.startsWith("http")) {
.SetStyle("pointer-events: all;") .SetStyle("pointer-events: all;")
.AttachTo("topleft-tools"); .AttachTo("topleft-tools");
} }
// Remove all context event listeners on mobile to prevent long presses
window.addEventListener('contextmenu', (e) => { // Not compatible with IE < 9 window.addEventListener('contextmenu', (e) => { // Not compatible with IE < 9
if(e.target["nodeName"] === "INPUT"){
return;
}
e.preventDefault(); e.preventDefault();
return false;
}, false); }, false);