fix: remove aria-live region for autosuggest (#1520)

pull/1523/head
Nolan Lawson 2019-09-22 23:53:09 -07:00 zatwierdzone przez GitHub
rodzic 3338159eaa
commit 8f3b0ac80a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 19 usunięć

Wyświetl plik

@ -8,9 +8,6 @@
selected={autosuggestSelected}
{realm}
/>
<div class="sr-only" aria-live="assertive">
{assertiveAriaText}
</div>
</div>
<style>
.compose-autosuggest {
@ -57,7 +54,6 @@
import { selectAutosuggestItem } from '../../_actions/autosuggest'
import { observe } from 'svelte-extras'
import { once } from '../../_utils/once'
import { createAutosuggestAccessibleLabel } from '../../_utils/createAutosuggestAccessibleLabel'
export default {
oncreate () {
@ -111,21 +107,7 @@
/* eslint-enable camelcase */
shouldBeShown: ({ realm, $autosuggestShown, composeFocused }) => (
!!($autosuggestShown && composeFocused)
),
// text that is read to screen readers. based on https://haltersweb.github.io/Accessibility/autocomplete.html
assertiveAriaText: ({
shouldBeShown,
autosuggestSearchResults,
autosuggestSelected,
autosuggestType,
$omitEmojiInDisplayNames
}) => {
if (!shouldBeShown || !autosuggestSearchResults || !autosuggestSearchResults.length) {
return ''
}
return createAutosuggestAccessibleLabel(autosuggestType, $omitEmojiInDisplayNames,
autosuggestSelected, autosuggestSearchResults)
}
)
},
data: () => ({
shown: false