Skip to content

Commit

Permalink
Fix id in AriaInput
Browse files Browse the repository at this point in the history
  • Loading branch information
raksooo committed Jan 22, 2024
1 parent 43398ce commit d0366a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gui/src/renderer/components/AriaGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const AriaControlContext = React.createContext<IAriaControlContext>({
});

interface IAriaGroupProps {
describedId?: string;
children: React.ReactNode;
}

Expand Down Expand Up @@ -49,11 +50,11 @@ export function AriaDescriptionGroup(props: IAriaGroupProps) {

const contextValue = useMemo(
() => ({
describedId: `${id}-described`,
describedId: props.describedId ?? `${id}-described`,
descriptionId: hasDescription ? `${id}-description` : undefined,
setHasDescription,
}),
[hasDescription],
[hasDescription, props.describedId],
);

return (
Expand Down Expand Up @@ -94,7 +95,7 @@ export function AriaInputGroup(props: IAriaGroupProps) {
);

return (
<AriaDescriptionGroup>
<AriaDescriptionGroup describedId={contextValue.inputId}>
<AriaInputContext.Provider value={contextValue}>{props.children}</AriaInputContext.Provider>
</AriaDescriptionGroup>
);
Expand Down

0 comments on commit d0366a1

Please sign in to comment.