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

Fix(1030): adds a customizable property for aria-label #1765

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/api/props.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## ariaLabel

This value will be bound to the [aria-label
HTML attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label)
for the search input. Defaults to `Search for option`.

```js
ariaLabel: {
type: String,
default: 'Search for option'
},
```

## appendToBody <Badge text="v3.7.0+" />

Append the dropdown element to the end of the body
Expand Down
11 changes: 10 additions & 1 deletion src/components/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
role="combobox"
:aria-expanded="dropdownOpen.toString()"
:aria-owns="`vs${uid}__listbox`"
aria-label="Search for option"
:aria-label="ariaLabel"
@mousedown="toggleDropdown($event)"
>
<div ref="selectedOptions" class="vs__selected-options">
Expand Down Expand Up @@ -245,6 +245,15 @@ export default {
default: '',
},

/**
* Sets the value of the 'aria-label' for the search `<input>`.
* @type {String}
*/
ariaLabel: {
type: String,
default: 'Search for option',
},

/**
* Sets a Vue transition property on the `.vs__dropdown-menu`.
* @type {String}
Expand Down