querySelectorAll instead of querySelector

This commit is contained in:
2023-04-09 22:56:33 -05:00
parent 0903994c30
commit 9b499a2109
2 changed files with 2 additions and 10 deletions

View File

@@ -3,11 +3,7 @@ const Elems = `
.click-handler
`
const getElems = () =>
Elems.split(',')
.filter(l => l.trim().length)
.map(elem => document.querySelector<HTMLElement>(elem.trim()))
.filter((elem): elem is HTMLElement => elem !== null)
const getElems = () => Array.from(document.querySelectorAll<HTMLElement>(Elems))
const elemsSet = () =>
getElems().forEach(elem => (elem.style.pointerEvents = 'none'))