automatically insert only candidate on click

This commit is contained in:
Adrien MALINGREY 2020-11-13 02:12:58 +01:00
parent b20c6b72bd
commit c09d51555d

View File

@ -110,11 +110,19 @@ function onfocus() {
} }
function onclick() { function onclick() {
if (inkPenRadio.checked) { if (this.value == "" && this.candidates.size == 1) {
valueToInsert = this.candidates.values().next().value
document.getElementById("insertRadio" + valueToInsert).checked = true
this.value = valueToInsert this.value = valueToInsert
} else if (inkPenRadio.checked) {
if (valueToInsert)
this.value = valueToInsert
else
this.select()
} else if (pencilRadio.checked) { } else if (pencilRadio.checked) {
if (valueToInsert)
this.value += valueToInsert this.value += valueToInsert
} else { } else if (eraserRadio.checked) {
this.value = "" this.value = ""
this.placeholder = "" this.placeholder = ""
} }