Skip to content

fix(web-components): isolate radio option label targets - #4614

Open
sylvesterkaczmarek wants to merge 1 commit into
mi6:developfrom
sylvesterkaczmarek:fix/4165-unique-radio-option-ids
Open

fix(web-components): isolate radio option label targets#4614
sylvesterkaczmarek wants to merge 1 commit into
mi6:developfrom
sylvesterkaczmarek:fix/4165-unique-radio-option-ids

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary of the changes

Fix repeated radio groups with identical labels so each option label targets the radio input in its own group.

Radio option IDs previously used the option label/value plus the radio-group label. When multiple groups shared the same label, equivalent options produced duplicate DOM IDs, so clicking a label in a later group could activate the first group's input.

The fix keeps existing IDs unchanged for ordinary single-group cases, but includes the required radio-group name when the same group label appears more than once on the page.

A focused regression test renders two groups with identical labels and verifies that all radio input IDs are unique and every label points to its own input.

Closes #4165

@GCHQ-Developer-530

Copy link
Copy Markdown
Contributor

Hi, thanks for this contribution. Please could you run prettier to pass the CI build? Also please could you squash your commits into one, there should be one commit per scope e.g. web-components 😊 Thank you

@sylvesterkaczmarek

Copy link
Copy Markdown
Author

@GCHQ-Developer-530 Thanks. I've applied the Prettier formatting fix and squashed the PR to a single web-components commit as requested. The new Actions runs are currently waiting for approval.

@lz405

lz405 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Thanks for contributing. We generally do not split test files per test, and keep tests grouped together per component.

@GCHQ-Developer-299
GCHQ-Developer-299 force-pushed the develop branch 2 times, most recently from e3b71bd to 1b185ad Compare August 20, 2026 12:06
@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Thanks for the guidance. I've moved the regression coverage into the existing ic-radio-group test file and kept the PR to a single web-components commit. The new Actions runs are currently waiting for maintainer approval.

@GCHQ-Developer-530

Copy link
Copy Markdown
Contributor

Please rebase this branch

@GCHQ-Developer-530
GCHQ-Developer-530 force-pushed the fix/4165-unique-radio-option-ids branch from 61a75b7 to d561430 Compare August 25, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants