components/autofocus-ng/autofocus-ng.js
function focusOnElement(element) {
    if (!element) {
      return;
    }

    if (element.hasAttribute(RING_SELECT) || element.tagName.toLowerCase() === RING_SELECT) {
      focusOnElement(element.querySelector(RING_SELECT_SELECTOR));
      return;
    }

    if (element.matches(FOCUSABLE_ELEMENTS) && element.focus) {
      element.focus();
      return;
    }

    const focusableChild = element.querySelector(FOCUSABLE_ELEMENTS);

    if (focusableChild && focusableChild.focus) {
      focusableChild.focus();
    }
  }
function focusOnElement(element) {
    if (!element) {
      return;
    }

    if (element.hasAttribute(RING_SELECT) || element.tagName.toLowerCase() === RING_SELECT) {
      focusOnElement(element.querySelector(RING_SELECT_SELECTOR));
      return;
    }

    if (element.matches(FOCUSABLE_ELEMENTS) && element.focus) {
      element.focus();
      return;
    }

    const focusableChild = element.querySelector(FOCUSABLE_ELEMENTS);

    if (focusableChild && focusableChild.focus) {
      focusableChild.focus();
    }
  }
function focusOnElement ( element ) { if ( ! element ) { return ; } if ( element . hasAttribute ( RING_SELECT ) || element . tagName . toLowerCase ( ) === RING_SELECT ) { focusOnElement ( element . querySelector ( RING_SELECT_SELECTOR ) ) ; return ; } if ( element . matches ( FOCUSABLE_ELEMENTS ) && element . focus ) { element . focus ( ) ; return ; } const focusableChild = element . querySelector ( FOCUSABLE_ELEMENTS ) ; if ( focusableChild && focusableChild . focus ) { focusableChild . focus ( ) ; } }
Focuses on element itself if it has "focus" method.
Searches and focuses on select's button or input if element is rg-select
@param element
Focuses on element itself if it has focus method . Searches and focuses on select s button or input if element is rg - select