focus = (el, toggleTabIndex) => {
    if (!el) return;

    /**
     * Momentarily add the `tabindex` attribute to fix
     * a bug with focus restoration in chrome
     */
    toggleTabIndex && (el.tabIndex = -1);

    el.focus();

    /**
     * Remove the `tabindex` attribute so
     * that the html markup is valid again
     */
    toggleTabIndex && el.removeAttribute('tabindex');
}
@param {HTMLElement} el
@param {boolean} [toggleTabIndex]