Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(NcSelect): Improve accessibility #5036

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ msgstr ""
msgid "Open navigation"
msgstr ""

msgid "Options"
msgstr ""

msgid "Password is secure"
msgstr ""

Expand Down
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@nextcloud/l10n": "^2.0.1",
"@nextcloud/logger": "^2.2.1",
"@nextcloud/router": "^2.0.0",
"@nextcloud/vue-select": "^3.24.0",
"@nextcloud/vue-select": "^3.25.0",
"@vueuse/components": "^10.0.2",
"@vueuse/core": "^10.1.2",
"clone": "^2.1.2",
Expand Down
13 changes: 12 additions & 1 deletion src/components/NcSelect/NcSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ export default {
<template #open-indicator="{ attributes }">
<ChevronDown v-bind="attributes"
fill-color="var(--vs-controls-color)"
:style="{
cursor: !disabled ? 'pointer' : null,
}"
:size="26" />
<!-- Set size to 26 to make up for the increased padding of this icon -->
</template>
Expand Down Expand Up @@ -569,6 +572,14 @@ export default {
default: null,
},

/**
* `aria-label` for the listbox element
*/
ariaLabelListbox: {
type: String,
default: t('Options'),
},

/**
* Allows to customize the `aria-label` for the deselect-option button
* The default is "Deselect " + optionLabel
Expand Down Expand Up @@ -838,7 +849,7 @@ export default {
*/
uid: {
type: String,
default: () => '-' + GenRandomId(),
default: () => GenRandomId(),
},

/**
Expand Down
Loading