Skip to content

Commit

Permalink
Add aria-labels to colorpicker buttons
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Jan 26, 2023
1 parent f23f8e4 commit e4b181c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ msgstr ""
msgid "Avatar of {displayName}, {status}"
msgstr ""

msgid "Back"
msgstr ""

msgid "Cancel changes"
msgstr ""

Expand Down Expand Up @@ -92,6 +95,9 @@ msgstr ""
msgid "More items …"
msgstr ""

msgid "More options"
msgstr ""

msgid "Next"
msgstr ""

Expand Down
10 changes: 7 additions & 3 deletions src/components/NcColorPicker/NcColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,15 @@ export default {
<div class="color-picker__navigation">
<NcButton v-if="advanced"
type="tertiary"
:aria-label="ariaBack"
@click="handleBack">
<template #icon>
<ArrowLeft :size="20" />
</template>
</NcButton>
<NcButton v-if="!advanced"
type="tertiary"
:aria-label="ariaMore"
@click="handleMoreSettings">
<template #icon>
<DotsHorizontal :size="20" />
Expand All @@ -213,7 +215,7 @@ export default {
<script>
import NcButton from '../NcButton/index.js'
import NcPopover from '../NcPopover/index.js'
import l10n from '../../mixins/l10n.js'
import { t } from '../../l10n.js'
import GenColors from '../../utils/GenColors.js'
import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
Expand All @@ -239,8 +241,6 @@ export default {
NcPopover,
},
mixins: [l10n],
props: {
/**
* A HEX color that represents the initial value of the picker
Expand Down Expand Up @@ -284,6 +284,8 @@ export default {
return {
currentColor: this.value,
advanced: false,
ariaBack: t('Back'),
ariaMore: t('More options'),
}
},
Expand All @@ -294,6 +296,8 @@ export default {
},
methods: {
t,
/**
* Submit a picked colour and close picker
*/
Expand Down

0 comments on commit e4b181c

Please sign in to comment.