From d0366a10ce7c9b2038a05bc24838e97dd792c7a3 Mon Sep 17 00:00:00 2001 From: Oskar Nyberg Date: Thu, 21 Dec 2023 20:24:19 +0100 Subject: [PATCH] Fix id in AriaInput --- gui/src/renderer/components/AriaGroup.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gui/src/renderer/components/AriaGroup.tsx b/gui/src/renderer/components/AriaGroup.tsx index 9f7755cb6ae5..8adf3243afc3 100644 --- a/gui/src/renderer/components/AriaGroup.tsx +++ b/gui/src/renderer/components/AriaGroup.tsx @@ -16,6 +16,7 @@ const AriaControlContext = React.createContext({ }); interface IAriaGroupProps { + describedId?: string; children: React.ReactNode; } @@ -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 ( @@ -94,7 +95,7 @@ export function AriaInputGroup(props: IAriaGroupProps) { ); return ( - + {props.children} );