From c312e47e9623df44bb1a560a0a3d1b8ae5885bf0 Mon Sep 17 00:00:00 2001 From: Airike Jaska <95303654+airikej@users.noreply.github.com> Date: Wed, 14 Jan 2026 12:51:42 +0200 Subject: [PATCH 1/2] fix(radio): wcag improvements #56 --- src/tedi/components/form/radio/radio.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tedi/components/form/radio/radio.tsx b/src/tedi/components/form/radio/radio.tsx index a98c40511..4645bd55a 100644 --- a/src/tedi/components/form/radio/radio.tsx +++ b/src/tedi/components/form/radio/radio.tsx @@ -28,6 +28,7 @@ export const Radio = (props: RadioProps): JSX.Element => { invalid, ...rest } = props; + const [innerChecked, setInnerChecked] = React.useState(defaultChecked || false); const labelRef = React.useRef(null); @@ -43,6 +44,9 @@ export const Radio = (props: RadioProps): JSX.Element => { }; const helperId = helper ? helper?.id ?? `${id}-helper` : undefined; + const tooltipId = tooltip ? `${id}-tooltip` : undefined; + const describedbyIds = [helperId, tooltipId].filter(Boolean).join(' '); + const LabelBEM = cn(styles['tedi-radio'], { [styles['tedi-radio--disabled']]: disabled }); return ( @@ -59,6 +63,7 @@ export const Radio = (props: RadioProps): JSX.Element => { checked={getChecked} onChange={onChangeHandler} className={styles['tedi-radio__input']} + aria-describedby={describedbyIds || undefined} />