Skip to content

Commit e229a45

Browse files
committed
chore: apply fix to radioSelection as well
1 parent 4c40b40 commit e229a45

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/pluggableWidgets/checkbox-radio-selection-web/src/components/CheckboxSelection/CheckboxSelection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export function CheckboxSelection({
6060
disabled={isReadOnly}
6161
tabIndex={tabIndex}
6262
onChange={e => handleChange(optionId, e.target.checked)}
63+
aria-describedby={selector.validation ? errorId : undefined}
64+
aria-invalid={selector.validation ? true : undefined}
6365
/>
6466
<CaptionContent
6567
onClick={(e: MouseEvent<HTMLDivElement>) => {
@@ -76,7 +78,7 @@ export function CheckboxSelection({
7678
);
7779
})}
7880
{options.length === 0 && <Placeholder noOptionsText={noOptionsText} />}
79-
{validation && <ValidationAlert referenceId={errorId}>{validation}</ValidationAlert>}
81+
{validation && <ValidationAlert id={errorId}>{validation}</ValidationAlert>}
8082
</div>
8183
);
8284
}

packages/pluggableWidgets/checkbox-radio-selection-web/src/components/RadioSelection/RadioSelection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ export function RadioSelection({
7575
disabled={isReadOnly}
7676
tabIndex={tabIndex}
7777
onChange={handleChange}
78+
aria-describedby={selector.validation ? errorId : undefined}
79+
aria-invalid={selector.validation ? true : undefined}
7880
/>
7981
</If>
8082
<CaptionContent
@@ -94,7 +96,7 @@ export function RadioSelection({
9496
);
9597
})}
9698
{options.length === 0 && <Placeholder noOptionsText={noOptionsText} />}
97-
{validation && <ValidationAlert referenceId={errorId}>{validation}</ValidationAlert>}
99+
{validation && <ValidationAlert id={errorId}>{validation}</ValidationAlert>}
98100
</div>
99101
);
100102
}

0 commit comments

Comments
 (0)