diff --git a/src/layout/RadioButtons/ControlledRadioGroup.tsx b/src/layout/RadioButtons/ControlledRadioGroup.tsx index 481598acef..5f82c115d4 100644 --- a/src/layout/RadioButtons/ControlledRadioGroup.tsx +++ b/src/layout/RadioButtons/ControlledRadioGroup.tsx @@ -77,6 +77,8 @@ export const ControlledRadioGroup = (props: PropsFromGenericComponent<'RadioButt ); const hideLabel = overrideDisplay?.renderedInTable === true && calculatedOptions.length === 1 && !showLabelsInTable; + const renderLegend = overrideDisplay?.renderLegend !== false; + const fieldsetAriaLabel = !renderLegend ? langAsString(textResourceBindings?.title) : undefined; const shouldDisplayHorizontally = shouldUseRowLayout({ layout, optionsCount: calculatedOptions.length, @@ -93,12 +95,11 @@ export const ControlledRadioGroup = (props: PropsFromGenericComponent<'RadioButt return (
-
- - {labelText} - +
+ {renderLegend && {labelText}} {textResourceBindings?.description && (