How to use the @fluentui/react.Menu.className function in @fluentui/react

To help you get started, we’ve selected a few @fluentui/react 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 / docs / src / examples / components / Menu / Usage / MenuExampleToolbar.shorthand.steps.ts View on Github external
import { Menu } from '@fluentui/react'
import getScreenerSteps from '../commonScreenerSteps'

const selectors = {
  menu: `.${Menu.className}`,
  item: (itemIndex: number) => `.${Menu.className} li:nth-child(${itemIndex}) a`,
  lastItem: `.${Menu.className} li:last-child a`,
}

const config: ScreenerTestsConfig = {
  themes: ['teams', 'teamsDark', 'teamsHighContrast'],
  steps: [
    (builder, keys) =>
      getScreenerSteps({ startItem: 2, endItem: 4 })[0](builder, keys)
        .click(selectors.lastItem)
        .snapshot('Clicks on the last item and opens submenu')

        .keys(selectors.lastItem, keys.downArrow)
        .snapshot('Focuses on the first element in the submenu'),
  ],
}

export default config
github microsoft / fluent-ui-react / docs / src / examples / components / Menu / commonScreenerSteps.ts View on Github external
  item: (itemIndex: number) => `.${Menu.className} li:nth-child(${itemIndex}) a`,
}