|
3 | 3 | class="voicecapture" |
4 | 4 | :class="{ active: status, [mode]: mode }" |
5 | 5 | @click="deactivateVoice" |
| 6 | + aria-modal="true" |
| 7 | + role="dialog" |
| 8 | + :aria-expanded="status ? 'true' : 'false'" |
6 | 9 | > |
7 | | - <button class="exit" type="button" @click="deactivateVoice"> |
8 | | - <i class="icon icon-exit">X</i> |
| 10 | + <button |
| 11 | + class="exit" |
| 12 | + @click="deactivateVoice" |
| 13 | + :aria-label="getTranslation('close')" |
| 14 | + type="button" |
| 15 | + > |
| 16 | + <i class="icon icon-exit" aria-hidden="true">X</i> |
9 | 17 | </button> |
10 | | - <p class="text-tip">{{ translatedText }}</p> |
| 18 | + <p class="text-tip" aria-live="polite">{{ translatedText }}</p> |
11 | 19 | <button |
12 | 20 | type="button" |
13 | 21 | class="btn-voice" |
14 | 22 | :class="{ active: animationButton }" |
| 23 | + :aria-label="getTranslation('open')" |
15 | 24 | > |
16 | | - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> |
| 25 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true"> |
17 | 26 | <path d="M17 11.998c0 2.76-2.23 5-4.99 5l-.002.002a4.994 4.994 0 01-4.979-5h-2c0 3.52 2.59 6.433 5.98 6.92v3.078h.01V22h2v-3.08h-.01A6.982 6.982 0 0019 11.998z" /> |
18 | 27 | <path fill="none" d="M0 0h24v24H0z" /> |
19 | 28 | <path d="M12 15c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v7c0 1.66 1.34 3 3 3z" /> |
@@ -66,12 +75,10 @@ export default { |
66 | 75 | }; |
67 | 76 |
|
68 | 77 | const deactivateVoice = () => { |
69 | | - if (recognizing.value && recognition.value) { |
70 | | - recognizing.value = false; |
71 | | - animationButton.value = false; |
72 | | - recognition.value.stop(); |
73 | | - emit('onStatus', false); |
74 | | - } |
| 78 | + recognizing.value = false; |
| 79 | + animationButton.value = false; |
| 80 | + recognition.value.stop(); |
| 81 | + emit('onStatus', false); |
75 | 82 | }; |
76 | 83 |
|
77 | 84 | const setupVoiceRecognition = () => { |
@@ -169,6 +176,7 @@ export default { |
169 | 176 | translatedText, |
170 | 177 | activateVoice, |
171 | 178 | deactivateVoice, |
| 179 | + getTranslation |
172 | 180 | }; |
173 | 181 | }, |
174 | 182 | }; |
|
0 commit comments