getVisibleNode function

Element? getVisibleNode(
  1. Element? element
)

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;
}