Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added id to Checkbox component to proper a11y identification #6802

Merged
merged 3 commits into from
Mar 5, 2025
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
1 change: 1 addition & 0 deletions packages/volto/news/6802.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a11y - Added id attribute to checkbox widget for proper identification and fixes label functionality for screen readers. @Wagner3UB
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const CheckboxWidget = (props) => {
<FormFieldWrapper {...props} columns={1}>
<div className="wrapper">
<Checkbox
id={`field-${id}`}
name={`field-${id}`}
checked={value || false}
disabled={isDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exports[`CheckboxWidget renders a checkbox widget component 1`] = `
>
<input
class="hidden"
id="field-my-field"
name="field-my-field"
readonly=""
tabindex="0"
Expand Down Expand Up @@ -65,6 +66,7 @@ exports[`CheckboxWidget renders a checkbox widget component checked 1`] = `
<input
checked=""
class="hidden"
id="field-my-field"
name="field-my-field"
readonly=""
tabindex="0"
Expand Down