From afbf9c7d88b78629c134a6297b9506c658d60464 Mon Sep 17 00:00:00 2001 From: Pete <107579368+thiessenp-cds@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:33:22 -0500 Subject: [PATCH] fix: for Radio button / group unexpected behaviour (#4708) * Removes unnecessary tabindex on form control container * Update to make the form group focussable --- components/clientComponents/forms/FormGroup/FormGroup.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/clientComponents/forms/FormGroup/FormGroup.tsx b/components/clientComponents/forms/FormGroup/FormGroup.tsx index a47e6800af..5e8a228454 100644 --- a/components/clientComponents/forms/FormGroup/FormGroup.tsx +++ b/components/clientComponents/forms/FormGroup/FormGroup.tsx @@ -22,8 +22,9 @@ export const FormGroup = (props: FormGroupProps): React.ReactElement => { data-testid="formGroup" className={classes} aria-describedby={ariaDescribedBy} - // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex - tabIndex={0} + // Used to programmatically focus a form group by e.g. a form validation skip ahead link + // -1 is used over 0, so the group is not in the natural tab order which is confusing for AT + tabIndex={-1} > {children}