Skip to content

Commit 52e587a

Browse files
authored
Merge pull request #11 from howard-tzw/feat/aria-label
Adds a customizable property for aria-label
2 parents fe63377 + 160bef3 commit 52e587a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

docs/api/props.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## ariaLabel
2+
3+
This value will be bound to the [aria-label
4+
HTML attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label)
5+
for the search input. Defaults to `Search for option`.
6+
7+
```js
8+
ariaLabel: {
9+
type: String,
10+
default: 'Search for option'
11+
},
12+
```
13+
114
## appendToBody <Badge text="v3.7.0+" />
215

316
Append the dropdown element to the end of the body

src/components/Select.vue

+10-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
role="combobox"
1313
:aria-expanded="dropdownOpen.toString()"
1414
:aria-owns="`vs${uid}__listbox`"
15-
aria-label="Search for option"
15+
:aria-label="ariaLabel"
1616
v-click-outside="clickOutside"
1717
@mousedown="toggleDropdown($event)"
1818
>
@@ -246,6 +246,15 @@ export default {
246246
default: false,
247247
},
248248
249+
/**
250+
* Sets the value of the 'aria-label' for the search `<input>`.
251+
* @type {String}
252+
*/
253+
ariaLabel: {
254+
type: String,
255+
default: 'Search for option',
256+
},
257+
249258
/**
250259
* Enable/disable filtering the options.
251260
* @type {Boolean}

0 commit comments

Comments
 (0)