Fix mobile long-press selecting button title

This commit is contained in:
Neale Pickett 2022-04-26 10:04:39 -06:00
parent 1ac866511a
commit e60cb074f0
2 changed files with 3 additions and 1 deletions

View File

@ -13,11 +13,12 @@ export class HTML extends Input{
// Listen to HTML buttons
for (let e of document.querySelectorAll("button.key")) {
e.addEventListener("contextmenu", e => { return false }, {passive: true})
e.addEventListener("contextmenu", e => { e.preventDefault(); return false }, {passive: false})
e.addEventListener("touchstart", e => this.keyButton(e), {passive: true})
e.addEventListener("touchend", e => this.keyButton(e), {passive: true})
e.addEventListener("mousedown", e => this.keyButton(e), {passive: true})
e.addEventListener("mouseup", e => this.keyButton(e), {passive: true})
e.contentEditable = false
}
}

View File

@ -12,6 +12,7 @@
.key {
width: 100%;
height: 6em;
user-select: none;
}
.center {