From d002b1cce3064fed957bbfe5fe886cf62e0f6f3a Mon Sep 17 00:00:00 2001 From: Magnus Revheim Martinsen Date: Thu, 14 Aug 2025 14:37:04 +0200 Subject: [PATCH] fix broken aria references in table --- src/layout/Checkboxes/CheckboxesContainerComponent.tsx | 6 +++++- src/layout/Input/InputComponent.tsx | 4 +++- src/layout/RadioButtons/ControlledRadioGroup.tsx | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/layout/Checkboxes/CheckboxesContainerComponent.tsx b/src/layout/Checkboxes/CheckboxesContainerComponent.tsx index f05dc8ac58..f31128ac3a 100644 --- a/src/layout/Checkboxes/CheckboxesContainerComponent.tsx +++ b/src/layout/Checkboxes/CheckboxesContainerComponent.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Fieldset, useCheckboxGroup } from '@digdir/designsystemet-react'; +import cn from 'classnames'; import { ConditionalWrapper } from 'src/app-components/ConditionalWrapper/ConditionalWrapper'; import { AltinnSpinner } from 'src/components/AltinnSpinner'; @@ -13,6 +14,7 @@ import { useIsValid } from 'src/features/validation/selectors/isValid'; import classes from 'src/layout/Checkboxes/CheckboxesContainerComponent.module.css'; import { WrappedCheckbox } from 'src/layout/Checkboxes/WrappedCheckbox'; import { ComponentStructureWrapper } from 'src/layout/ComponentStructureWrapper'; +import utilClasses from 'src/styles/utils.module.css'; import { shouldUseRowLayout } from 'src/utils/layout'; import { useIndexedId } from 'src/utils/layout/DataModelLocation'; import { useItemWhenType } from 'src/utils/layout/useNodeItem'; @@ -95,7 +97,9 @@ export const CheckboxContainerComponent = ({ {labelTextGroup} )} {textResourceBindings?.description && ( - + )} diff --git a/src/layout/Input/InputComponent.tsx b/src/layout/Input/InputComponent.tsx index e0979fc690..1bd6f2d160 100644 --- a/src/layout/Input/InputComponent.tsx +++ b/src/layout/Input/InputComponent.tsx @@ -133,7 +133,9 @@ export const InputVariant = ({ id, 'aria-label': langAsString(textResourceBindings?.title), 'aria-describedby': - textResourceBindings?.title && textResourceBindings?.description ? getDescriptionId(id) : undefined, + overrideDisplay?.renderedInTable !== true && textResourceBindings?.title && textResourceBindings?.description + ? getDescriptionId(id) + : undefined, autoComplete: autocomplete, className: formatting?.align ? classes[`text-align-${formatting.align}`] : '', readOnly, diff --git a/src/layout/RadioButtons/ControlledRadioGroup.tsx b/src/layout/RadioButtons/ControlledRadioGroup.tsx index e941bd754a..481598acef 100644 --- a/src/layout/RadioButtons/ControlledRadioGroup.tsx +++ b/src/layout/RadioButtons/ControlledRadioGroup.tsx @@ -100,7 +100,9 @@ export const ControlledRadioGroup = (props: PropsFromGenericComponent<'RadioButt {labelText} {textResourceBindings?.description && ( - + )}