Skip to content

Commit

Permalink
feat(MobileDialogPrimitive): add aria-label, aria-labelledby props
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkaaa committed Nov 15, 2024
1 parent 5808dc6 commit a235c70
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const meta: Meta<typeof MobileDialogPrimitive> = {
removeUnderlinedText: false,
block: false,
lockScrolling: false,
"aria-label": "Mobile Dialog Primitive label",
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const MobileDialog = ({
removeUnderlinedText,
block = false,
lockScrolling,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledby,
}: Props) => {
const [render, setRender, setRenderWithTimeout, clearRenderTimeout] =
useStateWithTimeout<boolean>(false, 200);
Expand Down Expand Up @@ -76,6 +78,8 @@ const MobileDialog = ({
enabled={enabled}
removeUnderlinedText={removeUnderlinedText}
block={block}
aria-label={ariaLabel}
aria-labelledby={ariaLabelledby}
>
{children}
</TooltipWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export interface Props extends Common.Globals {
readonly stopPropagation?: boolean;
readonly removeUnderlinedText?: boolean;
readonly block?: boolean;
readonly "aria-label"?: string;
readonly "aria-labelledby"?: string;
}

0 comments on commit a235c70

Please sign in to comment.