don't worry about links
This commit is contained in:
parent
1197af67ef
commit
960f92b829
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user