Some small fixes
This commit is contained in:
parent
46e69ad87b
commit
c75b19630d
6 changed files with 28 additions and 21 deletions
|
@ -4,10 +4,12 @@ import { type } from "./utils.js"
|
|||
const input = document.querySelector("#go-input")
|
||||
|
||||
input.addEventListener("keydown", (event) => {
|
||||
if (event.code == "Space") {
|
||||
if (event.keyCode == "32") {
|
||||
event.preventDefault()
|
||||
type("-")
|
||||
} else if (!/^[-a-z0-9]+$/i.test(event.key)) event.preventDefault()
|
||||
return type("-")
|
||||
}
|
||||
if (event.keyCode === 13) return (location.href = input.value)
|
||||
if (!/^[-a-z0-9]+$/i.test(event.key)) event.preventDefault()
|
||||
})
|
||||
|
||||
const setHref = () =>
|
||||
|
|
Reference in a new issue