getVisibleNode function
Get the first visible element in the hierarchy.
Implementation
Element? getVisibleNode(Element? element) {
while (element!.hidden || element.style.display == 'none') {
var parent = element.parent;
if (parent != null) {
element = parent;
} else {
break;
}
}
return element;
}