mirror of https://github.com/vector-im/riot-web
Fix lack of screen reader indication when triggering auto complete (#10664)
parent
be5928cb64
commit
fdfe800b2c
|
@ -798,7 +798,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
|
||||||
};
|
};
|
||||||
|
|
||||||
const { completionIndex } = this.state;
|
const { completionIndex } = this.state;
|
||||||
const hasAutocomplete = Boolean(this.state.autoComplete);
|
const hasAutocomplete = !!this.state.autoComplete;
|
||||||
let activeDescendant: string | undefined;
|
let activeDescendant: string | undefined;
|
||||||
if (hasAutocomplete && completionIndex! >= 0) {
|
if (hasAutocomplete && completionIndex! >= 0) {
|
||||||
activeDescendant = generateCompletionDomId(completionIndex!);
|
activeDescendant = generateCompletionDomId(completionIndex!);
|
||||||
|
@ -828,7 +828,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
|
||||||
aria-multiline="true"
|
aria-multiline="true"
|
||||||
aria-autocomplete="list"
|
aria-autocomplete="list"
|
||||||
aria-haspopup="listbox"
|
aria-haspopup="listbox"
|
||||||
aria-expanded={hasAutocomplete ? true : undefined}
|
aria-expanded={hasAutocomplete ? !this.autocompleteRef.current?.state.hide : undefined}
|
||||||
aria-owns={hasAutocomplete ? "mx_Autocomplete" : undefined}
|
aria-owns={hasAutocomplete ? "mx_Autocomplete" : undefined}
|
||||||
aria-activedescendant={activeDescendant}
|
aria-activedescendant={activeDescendant}
|
||||||
dir="auto"
|
dir="auto"
|
||||||
|
|
Loading…
Reference in New Issue