Skip to content

Commit

Permalink
Allow disabled items to be keyboard focusable / accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Nov 22, 2023
1 parent 60a2bfc commit 310eb12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/components/src/dropdown-menu-v2-ariakit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const DropdownMenuItem = forwardRef<
<Styled.DropdownMenuItem
ref={ ref }
{ ...props }
accessibleWhenDisabled
hideOnClick={ hideOnClick }
store={ dropdownMenuContext?.store }
>
Expand Down Expand Up @@ -87,6 +88,7 @@ export const DropdownMenuCheckboxItem = forwardRef<
<Styled.DropdownMenuCheckboxItem
ref={ ref }
{ ...props }
accessibleWhenDisabled
hideOnClick={ hideOnClick }
store={ dropdownMenuContext?.store }
>
Expand Down Expand Up @@ -131,6 +133,7 @@ export const DropdownMenuRadioItem = forwardRef<
<Styled.DropdownMenuRadioItem
ref={ ref }
{ ...props }
accessibleWhenDisabled
hideOnClick={ hideOnClick }
store={ dropdownMenuContext?.store }
>
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/dropdown-menu-v2-ariakit/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ const baseItem = css`
}
/* Hover */
&[data-active-item]:not( [data-focus-visible] ) {
&[data-active-item]:not( [data-focus-visible] ):not(
[aria-disabled='true']
) {
background-color: ${ COLORS.theme.accent };
color: ${ COLORS.white };
}
Expand Down

0 comments on commit 310eb12

Please sign in to comment.