Skip to content

Commit e4b181c

Browse files
Add aria-labels to colorpicker buttons
Signed-off-by: Raimund Schlüßler <[email protected]>
1 parent f23f8e4 commit e4b181c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

l10n/messages.pot

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ msgstr ""
2626
msgid "Avatar of {displayName}, {status}"
2727
msgstr ""
2828

29+
msgid "Back"
30+
msgstr ""
31+
2932
msgid "Cancel changes"
3033
msgstr ""
3134

@@ -92,6 +95,9 @@ msgstr ""
9295
msgid "More items …"
9396
msgstr ""
9497

98+
msgid "More options"
99+
msgstr ""
100+
95101
msgid "Next"
96102
msgstr ""
97103

src/components/NcColorPicker/NcColorPicker.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,15 @@ export default {
188188
<div class="color-picker__navigation">
189189
<NcButton v-if="advanced"
190190
type="tertiary"
191+
:aria-label="ariaBack"
191192
@click="handleBack">
192193
<template #icon>
193194
<ArrowLeft :size="20" />
194195
</template>
195196
</NcButton>
196197
<NcButton v-if="!advanced"
197198
type="tertiary"
199+
:aria-label="ariaMore"
198200
@click="handleMoreSettings">
199201
<template #icon>
200202
<DotsHorizontal :size="20" />
@@ -213,7 +215,7 @@ export default {
213215
<script>
214216
import NcButton from '../NcButton/index.js'
215217
import NcPopover from '../NcPopover/index.js'
216-
import l10n from '../../mixins/l10n.js'
218+
import { t } from '../../l10n.js'
217219
import GenColors from '../../utils/GenColors.js'
218220
219221
import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
@@ -239,8 +241,6 @@ export default {
239241
NcPopover,
240242
},
241243
242-
mixins: [l10n],
243-
244244
props: {
245245
/**
246246
* A HEX color that represents the initial value of the picker
@@ -284,6 +284,8 @@ export default {
284284
return {
285285
currentColor: this.value,
286286
advanced: false,
287+
ariaBack: t('Back'),
288+
ariaMore: t('More options'),
287289
}
288290
},
289291
@@ -294,6 +296,8 @@ export default {
294296
},
295297
296298
methods: {
299+
t,
300+
297301
/**
298302
* Submit a picked colour and close picker
299303
*/

0 commit comments

Comments
 (0)