Skip to content

Commit

Permalink
fix(app): activate focus-visible on dropdown menu
Browse files Browse the repository at this point in the history
activate focus-visible on dropdown menu

close RQA-2659
  • Loading branch information
koji committed Apr 29, 2024
1 parent 321e348 commit cdc9a5a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/atoms/MenuList/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,24 @@ export interface DropdownOption {
export type DropdownBorder = 'rounded' | 'neutral'

export interface DropdownMenuProps {
/** dropdown options */
filterOptions: DropdownOption[]
/** click handler */
onClick: (value: string) => void
/** current selected option */
currentOption: DropdownOption
/** dropdown */
width?: string
/** dropdown style type */
dropdownType?: DropdownBorder
/** dropdown title */
title?: string
/** dropdown item caption */
caption?: string | null
/** text for tooltip */
tooltipText?: string
/** html tabindex property */
tabIndex?: number
}

// TODO: (smb: 4/15/22) refactor this to use html select for accessibility
Expand All @@ -50,6 +60,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {
title,
caption,
tooltipText,
tabIndex = 0,
} = props
const [targetProps, tooltipProps] = useHoverTooltip()
const [showDropdownMenu, setShowDropdownMenu] = React.useState<boolean>(false)
Expand Down Expand Up @@ -130,6 +141,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {
toggleSetShowDropdownMenu()
}}
css={DROPDOWN_STYLE}
tabIndex={tabIndex}
>
<StyledText
css={css`
Expand Down

0 comments on commit cdc9a5a

Please sign in to comment.