Skip to content

Commit

Permalink
fix(MenuItem): change condition of ariaLabel (#1939)
Browse files Browse the repository at this point in the history
  • Loading branch information
talkor authored Feb 11, 2024
1 parent 28dff21 commit dd46c24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Menu/MenuItem/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export interface MenuItemProps extends VibeComponentProps {

interface MenuItemTitleComponentProps extends Omit<MenuItemProps, "title"> {
title: ReactElement;
"aria-label": AriaAttributes["aria-label"];
"aria-label": NonNullable<AriaAttributes["aria-label"]>;
}

const MenuItem: VibeComponent<MenuItemProps | MenuItemTitleComponentProps> & {
Expand Down Expand Up @@ -238,7 +238,7 @@ const MenuItem: VibeComponent<MenuItemProps | MenuItemTitleComponentProps> & {
);

// if "title" is a component ariaLabel is mandatory
const iconLabel = ariaLabel || (title as string);
const iconLabel = ariaLabel ?? (title as string);
const renderSubMenuIconIfNeeded = () => {
if (!hasChildren) return null;

Expand Down

0 comments on commit dd46c24

Please sign in to comment.