diff --git a/docs/api/props.md b/docs/api/props.md index 6dcccec93..184fb1929 100644 --- a/docs/api/props.md +++ b/docs/api/props.md @@ -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 Append the dropdown element to the end of the body diff --git a/src/components/Select.vue b/src/components/Select.vue index a4efc86e2..5dfe5552a 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -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)" >
@@ -245,6 +245,15 @@ export default { default: '', }, + /** + * Sets the value of the 'aria-label' for the search ``. + * @type {String} + */ + ariaLabel: { + type: String, + default: 'Search for option', + }, + /** * Sets a Vue transition property on the `.vs__dropdown-menu`. * @type {String}