diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2023-12-21 20:24:19 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2024-01-29 09:44:53 +0100 |
| commit | 55feda8944299f9540ad43adbb39b6ac81dc5a6f (patch) | |
| tree | 964cc3552f19691e17328f7ab924e9d38b495dc2 /gui/src | |
| parent | 9d559db04d709e45aff875e853c5ad8b63b37740 (diff) | |
| download | mullvadvpn-55feda8944299f9540ad43adbb39b6ac81dc5a6f.tar.xz mullvadvpn-55feda8944299f9540ad43adbb39b6ac81dc5a6f.zip | |
Fix id in AriaInput
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/renderer/components/AriaGroup.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gui/src/renderer/components/AriaGroup.tsx b/gui/src/renderer/components/AriaGroup.tsx index 9f7755cb6a..8adf3243af 100644 --- a/gui/src/renderer/components/AriaGroup.tsx +++ b/gui/src/renderer/components/AriaGroup.tsx @@ -16,6 +16,7 @@ const AriaControlContext = React.createContext<IAriaControlContext>({ }); 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 ( - <AriaDescriptionGroup> + <AriaDescriptionGroup describedId={contextValue.inputId}> <AriaInputContext.Provider value={contextValue}>{props.children}</AriaInputContext.Provider> </AriaDescriptionGroup> ); |
