mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Make sure elements are unqiue after concat
This commit is contained in:
parent
08c6d475c6
commit
972f80b88e
2 changed files with 3 additions and 1 deletions
|
@ -748,7 +748,8 @@ function pushSpace() {
|
|||
export function hintables(selectors = DOM.HINTTAGS_selectors, withjs = false) {
|
||||
let elems = DOM.getElemsBySelector(selectors, [])
|
||||
if (withjs) {
|
||||
elems = [...elems, ...DOM.hintworthy_js_elems]
|
||||
const elemSet = new Set([...elems, ...DOM.hintworthy_js_elems])
|
||||
elems = [...elemSet]
|
||||
}
|
||||
return elems.filter(DOM.isVisible)
|
||||
}
|
||||
|
|
|
@ -229,6 +229,7 @@ export function isVisible(element: Element) {
|
|||
}
|
||||
|
||||
// remove elements that are barely within the viewport, tiny, or invisible
|
||||
// Only call getComputedStyle when necessary
|
||||
const computedStyle = getComputedStyle(element)
|
||||
switch (true) {
|
||||
case widthMatters(computedStyle) && clientRect.width < 3:
|
||||
|
|
Loading…
Add table
Reference in a new issue