Skip to content

Commit

Permalink
Labels accessibility for ArrayWidget, SelectWidget, TokenWidget (plon…
Browse files Browse the repository at this point in the history
…e#6332)

Co-authored-by: Piero Nicolli <[email protected]>
  • Loading branch information
folix-01 and pnicolli authored Sep 27, 2024
1 parent a2d997b commit d81a0d3
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/volto/news/6332.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Labels accessibility for ArrayWidget, SelectWidget, TokenWidget. @folix-01
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ class ArrayWidget extends Component {
// small fix for https://github.com/clauderic/react-sortable-hoc/pull/352:
getHelperDimensions={({ node }) => node.getBoundingClientRect()}
id={`field-${this.props.id}`}
aria-labelledby={`fieldset-${this.props.fieldSet}-field-label-${this.props.id}`}
key={this.props.id}
isDisabled={this.props.disabled || this.props.isDisabled}
className="react-select-container"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ class SelectWidget extends Component {
id={`field-${id}`}
key={choices}
name={id}
aria-labelledby={`fieldset-${this.props.fieldSet}-field-label-${id}`}
menuShouldScrollIntoView={false}
isDisabled={disabled}
isSearchable={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class TokenWidget extends Component {
<FormFieldWrapper {...this.props}>
<CreatableSelect
id={`field-${this.props.id}`}
aria-labelledby={`fieldset-${this.props.fieldSet}-field-label-${this.props.id}`}
key={this.props.id}
menuShouldScrollIntoView={false}
isDisabled={this.props.isDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ exports[`No 'No value' option when default value is 0 1`] = `
>
<input
aria-autocomplete="list"
aria-labelledby="fieldset-default-field-label-my-field"
autocapitalize="none"
autocomplete="off"
autocorrect="off"
Expand Down Expand Up @@ -212,6 +213,7 @@ exports[`renders an array widget component 1`] = `
>
<input
aria-autocomplete="list"
aria-labelledby="fieldset-default-field-label-my-field"
autoCapitalize="none"
autoComplete="off"
autoCorrect="off"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ exports[`No 'No value' option when default value is 0 1`] = `
>
<input
aria-autocomplete="list"
aria-labelledby="fieldset-default-field-label-my-field"
autocapitalize="none"
autocomplete="off"
autocorrect="off"
Expand Down Expand Up @@ -222,6 +223,7 @@ exports[`renders a select widget component 1`] = `
>
<input
aria-autocomplete="list"
aria-labelledby="fieldset-default-field-label-my-field"
autocapitalize="none"
autocomplete="off"
autocorrect="off"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ exports[`renders a token widget component 1`] = `
>
<input
aria-autocomplete="list"
aria-labelledby="fieldset-default-field-label-my-field"
autoCapitalize="none"
autoComplete="off"
autoCorrect="off"
Expand Down

0 comments on commit d81a0d3

Please sign in to comment.