A11y fix role-has-required-aria-props (#7455)
* remove jsx a11y direct use in eslintrc Signed-off-by: Kerry Archibald <kerrya@element.io> * remove debug Signed-off-by: Kerry Archibald <kerrya@element.io> * split aria-selected out from restProps in Autocomplete Signed-off-by: Kerry Archibald <kerrya@element.io> * update Dropdown to aria 1.1 aria-owns -> aria-controls Signed-off-by: Kerry Archibald <kerrya@element.io> * unignore jsx-a11y/role-has-required-aria-props rule Signed-off-by: Kerry Archibald <kerrya@element.io> * remove debug Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
846fbfa2a0
commit
aaf14aacd2
3 changed files with 24 additions and 5 deletions
|
@ -313,7 +313,7 @@ export default class Dropdown extends React.Component<IProps, IState> {
|
|||
);
|
||||
});
|
||||
if (options.length === 0) {
|
||||
return [<div key="0" className="mx_Dropdown_option" role="option">
|
||||
return [<div key="0" className="mx_Dropdown_option" role="option" aria-selected={false}>
|
||||
{ _t("No results") }
|
||||
</div>];
|
||||
}
|
||||
|
@ -331,6 +331,7 @@ export default class Dropdown extends React.Component<IProps, IState> {
|
|||
if (this.props.searchEnabled) {
|
||||
currentValue = (
|
||||
<input
|
||||
id={`${this.props.id}_input`}
|
||||
type="text"
|
||||
autoFocus={true}
|
||||
className="mx_Dropdown_option"
|
||||
|
@ -339,7 +340,8 @@ export default class Dropdown extends React.Component<IProps, IState> {
|
|||
role="combobox"
|
||||
aria-autocomplete="list"
|
||||
aria-activedescendant={`${this.props.id}__${this.state.highlightedOption}`}
|
||||
aria-owns={`${this.props.id}_listbox`}
|
||||
aria-expanded={this.state.expanded}
|
||||
aria-controls={`${this.props.id}_listbox`}
|
||||
aria-disabled={this.props.disabled}
|
||||
aria-label={this.props.label}
|
||||
onKeyDown={this.onKeyDown}
|
||||
|
@ -382,6 +384,7 @@ export default class Dropdown extends React.Component<IProps, IState> {
|
|||
inputRef={this.buttonRef}
|
||||
aria-label={this.props.label}
|
||||
aria-describedby={`${this.props.id}_value`}
|
||||
aria-owns={`${this.props.id}_input`}
|
||||
onKeyDown={this.onKeyDown}
|
||||
>
|
||||
{ currentValue }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue