fix: improve a11y of autosuggest labels (#1830)

This commit is contained in:
Nolan Lawson 2020-07-06 22:27:04 -07:00 committed by GitHub
parent 780db2be22
commit bd09718cf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@ export function createAutosuggestAccessibleLabel (
const selected = searchResults[selectedIndex] const selected = searchResults[selectedIndex]
let label let label
if (autosuggestType === 'emoji') { if (autosuggestType === 'emoji') {
label = `${selected.unicode || selected.name}` label = selected.name || [selected.unicode].concat(selected.shortcodes).join(', ')
} else if (autosuggestType === 'hashtag') { } else if (autosuggestType === 'hashtag') {
label = `#${selected.name}` label = `#${selected.name}`
} else { // account } else { // account