Update error handling
This commit is contained in:
parent
3d3a437ed2
commit
3db4702d93
|
@ -635,9 +635,19 @@
|
||||||
setJumpParam(undefined)
|
setJumpParam(undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
rangeInput.addEventListener("input", e => setJumpParam(rangeInput.value))
|
const jumpToInput = () => {
|
||||||
rangeInput.addEventListener("keydown", e => e.key === "Enter" && jump(rangeInput.value))
|
try {
|
||||||
document.getElementById("range-button").addEventListener("click", () => jump(rangeInput.value))
|
jump(rangeInput.value)
|
||||||
|
setJumpParam(rangeInput.value)
|
||||||
|
rangeInput.setCustomValidity("")
|
||||||
|
} catch (e) {
|
||||||
|
rangeInput.setCustomValidity(e.message)
|
||||||
|
}
|
||||||
|
rangeInput.reportValidity()
|
||||||
|
}
|
||||||
|
|
||||||
|
rangeInput.addEventListener("change", jumpToInput)
|
||||||
|
document.getElementById("range-button").addEventListener("click", jumpToInput)
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue