onBlur method

  1. @HostListener('blur')
void onBlur(
  1. FocusEvent event
)

Implementation

@HostListener('blur')
void onBlur(FocusEvent event) {
  // Don't hide the tooltip if the user clicked an empty area on the page.
  if (event.relatedTarget == null) return;

  // Don't hide the tooltip if focus went to an element inside the tooltip.
  HtmlElement? el;
  for (el = event.relatedTarget as HtmlElement?;
      el!.parent != null;
      el = el.parent as HtmlElement?) {
    if (el.className == overlayContainerClassName) return;
  }

  hideTooltip(immediate: true);
}