Skip to content

Commit

Permalink
Try fixing combobox a11y issues (#27431) (#27454)
Browse files Browse the repository at this point in the history
* Fix label announcement on VoiceOver

* Try to fix selection announcement

* Revert commented line.
  • Loading branch information
tellthemachines authored Dec 3, 2020
1 parent ffb98cc commit c29fb7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/components/src/combobox-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function ComboboxControl( {
)
: __( 'No results.' );

speak( message, 'assertive' );
speak( message, 'polite' );
}
}, [ matchingSuggestions, isExpanded ] );

Expand Down Expand Up @@ -203,6 +203,11 @@ function ComboboxControl( {
instanceId={ instanceId }
ref={ inputContainer }
value={ isExpanded ? inputValue : currentLabel }
aria-label={
currentLabel
? `${ currentLabel }, ${ label }`
: null
}
onFocus={ onFocus }
isExpanded={ isExpanded }
selectedSuggestionIndex={ matchingSuggestions.indexOf(
Expand Down

0 comments on commit c29fb7f

Please sign in to comment.