Fix lack of screen reader indication when triggering auto complete (#10664)

t3chguy/dedup-icons-17oct
Michael Telatynski 2023-04-21 10:49:05 +01:00 committed by GitHub
parent be5928cb64
commit fdfe800b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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"