VisualSelector - Exclude items that are not interactable or visible

pull/1208/head
dgtlmoon 2 years ago
parent b58fd995b5
commit 09e6624afd

@ -81,6 +81,14 @@ var bbox;
for (var i = 0; i < elements.length; i++) { for (var i = 0; i < elements.length; i++) {
bbox = elements[i].getBoundingClientRect(); bbox = elements[i].getBoundingClientRect();
// Exclude items that are not interactable or visible
if(elements[i].style.opacity === "0") {
continue
}
if(elements[i].style.display === "none" || elements[i].style.pointerEvents === "none" ) {
continue
}
// Forget really small ones // Forget really small ones
if (bbox['width'] < 10 && bbox['height'] < 10) { if (bbox['width'] < 10 && bbox['height'] < 10) {
continue; continue;

Loading…
Cancel
Save