Skip to content

Commit

Permalink
ON-41323 # Changed how aria-describedby was function for radio and ch…
Browse files Browse the repository at this point in the history
…eckbox elements
  • Loading branch information
jdawg093 committed Jun 21, 2024
1 parent 916bec1 commit f94d569
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- `aria-describedby` for `Radio` and `Checkbox` elements

## [6.2.0] - 2024-06-21

### Added
Expand Down
10 changes: 5 additions & 5 deletions src/form-elements/FormElementCheckBoxes.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import clsx from 'clsx'
import { Checkbox } from '@mui/material'
import { Checkbox, FormGroup } from '@mui/material'

import FormElementOptions from '../components/renderer/FormElementOptions'
import useFormElementOptions from '../hooks/useFormElementOptions'
Expand Down Expand Up @@ -160,11 +160,11 @@ function FormElementCheckboxes({
</div>
</div>
) : (
<div
role="group"
<FormGroup
className="ob-checkbox-container"
aria-labelledby={`${id}-label`}
aria-describedby={ariaDescribedby}
aria-description={ariaDescribedby}
role="group"
>
{filteredOptions.map((option, index) => {
const isSelected = selectedValues.includes(option.value)
Expand Down Expand Up @@ -195,7 +195,7 @@ function FormElementCheckboxes({
</div>
)
})}
</div>
</FormGroup>
)}

<LookupButton
Expand Down
4 changes: 1 addition & 3 deletions src/form-elements/FormElementRadio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ function FormElementRadio({
})
}}
edge="start"
inputProps={{
'aria-describedby': ariaDescribedby,
}}
/>
{` ${option.label}`}
</label>
Expand Down Expand Up @@ -132,6 +129,7 @@ function FormElementRadio({
'is-light': !isSelected,
},
)}
aria-describedby={ariaDescribedby}
/>
</div>
)
Expand Down

0 comments on commit f94d569

Please sign in to comment.