How to use the @fluentui/react-bindings.getFirstFocusable function in @fluentui/react-bindings

To help you get started, we’ve selected a few @fluentui/react-bindings examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / fluent-ui-react / packages / react / src / components / MenuButton / focusUtils.ts View on Github external
export const focusMenuItem = (menuRef: HTMLElement, order: 'first' | 'last') => {
  const element =
    order === 'first'
      ? getFirstFocusable(menuRef, menuRef.firstElementChild as HTMLElement, true)
      : getLastFocusable(menuRef, menuRef.lastElementChild as HTMLElement, true)

  focusAsync(element)
}

@fluentui/react-bindings

A set of components and hooks to build components libraries and UI kits.

MIT
Latest version published 1 year ago

Package Health Score

76 / 100
Full package analysis

Similar packages