aboutsummaryrefslogtreecommitdiff
path: root/src/components/emoji_input/emoji_input.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/emoji_input/emoji_input.vue')
-rw-r--r--src/components/emoji_input/emoji_input.vue19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue
index 6df2cebe..4a7b0fa8 100644
--- a/src/components/emoji_input/emoji_input.vue
+++ b/src/components/emoji_input/emoji_input.vue
@@ -4,7 +4,13 @@
class="emoji-input"
:class="{ 'with-picker': !hideEmojiButton }"
>
- <slot />
+ <slot
+ :id="'textbox-' + randomSeed"
+ :aria-owns="suggestionListId"
+ aria-autocomplete="both"
+ :aria-expanded="showSuggestions"
+ :aria-activedescendant="(!showSuggestions || highlighted === -1) ? '' : suggestionItemId(highlighted)"
+ />
<!-- TODO: make the 'x' disappear if at the end maybe? -->
<div
ref="hiddenOverlay"
@@ -18,6 +24,10 @@
>x</span>
<span>{{ postText }}</span>
</div>
+ <screen-reader-notice
+ ref="screenReaderNotice"
+ aria-live="assertive"
+ />
<template v-if="enableEmojiPicker">
<button
v-if="!hideEmojiButton"
@@ -46,15 +56,20 @@
>
<template #content>
<div
+ :id="suggestionListId"
ref="panel-body"
class="autocomplete-panel-body"
+ role="listbox"
>
<div
v-for="(suggestion, index) in suggestions"
+ :id="suggestionItemId(index)"
:key="index"
class="autocomplete-item"
- role="button"
+ role="option"
:class="{ highlighted: index === highlighted }"
+ :aria-label="autoCompleteItemLabel(suggestion)"
+ :aria-selected="index === highlighted"
@click.stop.prevent="onClick($event, suggestion)"
>
<span class="image">