don't worry about links

This commit is contained in:
Chris Wanstrath 2025-09-28 16:32:00 -07:00
parent 1197af67ef
commit 960f92b829

View File

@ -23,18 +23,12 @@ export function focusHandler(e: MouseEvent) {
return
}
// let them click on links
const a = target.closest("a")
if (["INPUT", "TEXTAREA", "CANVAS", "A"].includes(target.tagName))
return false
if (!a) {
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.tagName === "CANVAS")
return false
const selection = window.getSelection() || ""
if (selection.toString() === "")
focusInput()
const selection = window.getSelection() || ""
if (selection.toString() === "")
focusInput()
e.preventDefault()
return true
}
e.preventDefault()
}