Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/layout/RadioButtons/ControlledRadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -93,12 +95,11 @@ export const ControlledRadioGroup = (props: PropsFromGenericComponent<'RadioButt
return (
<ComponentStructureWrapper baseComponentId={baseComponentId}>
<div id={id}>
<Fieldset role='radiogroup'>
<Fieldset.Legend
className={cn(classes.legend, { [utilClasses.visuallyHidden]: overrideDisplay?.renderLegend === false })}
>
{labelText}
</Fieldset.Legend>
<Fieldset
role='radiogroup'
aria-label={fieldsetAriaLabel}
>
{renderLegend && <Fieldset.Legend className={classes.legend}>{labelText}</Fieldset.Legend>}
{textResourceBindings?.description && (
<Fieldset.Description
className={cn({ [utilClasses.visuallyHidden]: overrideDisplay?.renderLegend === false })}
Expand Down
2 changes: 1 addition & 1 deletion src/layout/RepeatingGroup/RepeatingGroup.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Altinn, and making sure they are consistent. */
border-bottom-color: #dde3e5;
padding-top: 12px;
padding-bottom: 12px;
vertical-align: top;
vertical-align: -webkit-baseline-middle;
}
/* ==== */

Expand Down
7 changes: 1 addition & 6 deletions src/layout/RepeatingGroup/Table/RepeatingGroupTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ export function RepeatingGroupTableRow({

return (
<Table.Row
className={cn(
{
[classes.tableRowError]: rowHasErrors,
},
className,
)}
className={cn({ [classes.tableRowError]: rowHasErrors }, className)}
data-row-num={index}
data-row-uuid={uuid}
>
Expand Down