Skip to content

Commit

Permalink
Fix aria-labelledby logic
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis committed Apr 19, 2023
1 parent 2898d5d commit e28a73a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ActionList/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
onKeyPress: keyPressHandler,
'aria-disabled': disabled ? true : undefined,
tabIndex: disabled ? undefined : 0,
'aria-labelledby': `${labelId} ${slots.description?.props.variant !== 'block' ? inlineDescriptionId : ''}`,
'aria-labelledby': `${labelId} ${
slots.description && slots.description.props.variant !== 'block' ? inlineDescriptionId : ''
}`,
'aria-describedby': slots.description?.props.variant === 'block' ? blockDescriptionId : undefined,
...(selectionAttribute && {[selectionAttribute]: selected}),
role: role || itemRole,
Expand Down

0 comments on commit e28a73a

Please sign in to comment.