UNPKG

@inkline/inkline

Version:

Inkline is the Vue.js UI/UX Library built for creating your next design system

19 lines 519 B
import { isFocusable } from './isFocusable.mjs'; /** * Set Attempt to set focus on the current node. * * @param element The node to attempt to focus on. * @returns true if element is focused. */ export function focusAttempt(element) { if (!isFocusable(element)) { return false; } try { element.focus(); // eslint-disable-next-line } catch (e) { } return typeof window !== 'undefined' && document.activeElement === element; } //# sourceMappingURL=focusAttempt.mjs.map