Skip to content

Commit 098d07b

Browse files
committed
fix(inputs): don't override aria-label attribute
fixes #4642
1 parent 0693334 commit 098d07b

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

src/components/VTextField/VTextField.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,12 @@ export default {
314314
value: this.maskText(this.lazyValue)
315315
},
316316
attrs: {
317+
'aria-label': (!this.$attrs || !this.$attrs.id) && this.label, // Label `for` will be set if we have an id
317318
...this.$attrs,
318319
autofocus: this.autofocus,
319320
disabled: this.disabled,
320321
readonly: this.readonly,
321-
type: this.type,
322-
'aria-label': (!this.$attrs || !this.$attrs.id) && this.label // Label `for` will be set if we have an id
322+
type: this.type
323323
},
324324
on: Object.assign(listeners, {
325325
blur: this.onBlur,

test/unit/components/VDataIterator/__snapshots__/VDataIterator.spec.js.snap

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ exports[`VDataIterator.js should match a snapshot - footer slot 1`] = `
2424
<div class="v-select__selection v-select__selection--comma">
2525
5
2626
</div>
27-
<input readonly="readonly"
27+
<input aria-label="Items per page:"
28+
readonly="readonly"
2829
type="text"
2930
autocomplete="on"
3031
aria-readonly="false"
@@ -162,7 +163,8 @@ exports[`VDataIterator.js should match a snapshot - no data 1`] = `
162163
<div class="v-select__selection v-select__selection--comma">
163164
5
164165
</div>
165-
<input readonly="readonly"
166+
<input aria-label="Items per page:"
167+
readonly="readonly"
166168
type="text"
167169
autocomplete="on"
168170
aria-readonly="false"
@@ -291,7 +293,8 @@ exports[`VDataIterator.js should match a snapshot - no matching records 1`] = `
291293
<div class="v-select__selection v-select__selection--comma">
292294
5
293295
</div>
294-
<input readonly="readonly"
296+
<input aria-label="Items per page:"
297+
readonly="readonly"
295298
type="text"
296299
autocomplete="on"
297300
aria-readonly="false"
@@ -424,7 +427,8 @@ exports[`VDataIterator.js should match a snapshot - with data 1`] = `
424427
<div class="v-select__selection v-select__selection--comma">
425428
5
426429
</div>
427-
<input readonly="readonly"
430+
<input aria-label="Items per page:"
431+
readonly="readonly"
428432
type="text"
429433
autocomplete="on"
430434
aria-readonly="false"

test/unit/components/VDataTable/__snapshots__/VDataTable.spec.js.snap

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ exports[`VDataTable.vue should match a snapshot - no data 1`] = `
7777
<div class="v-menu__activator">
7878
<div class="v-select__slot">
7979
<div class="v-select__selections">
80-
<input readonly="readonly"
80+
<input aria-label="Rows per page:"
81+
readonly="readonly"
8182
type="text"
8283
autocomplete="on"
8384
aria-readonly="false"
@@ -257,7 +258,8 @@ exports[`VDataTable.vue should match a snapshot - no matching results 1`] = `
257258
<div class="v-menu__activator">
258259
<div class="v-select__slot">
259260
<div class="v-select__selections">
260-
<input readonly="readonly"
261+
<input aria-label="Rows per page:"
262+
readonly="readonly"
261263
type="text"
262264
autocomplete="on"
263265
aria-readonly="false"
@@ -439,7 +441,8 @@ exports[`VDataTable.vue should match a snapshot - with data 1`] = `
439441
<div class="v-menu__activator">
440442
<div class="v-select__slot">
441443
<div class="v-select__selections">
442-
<input readonly="readonly"
444+
<input aria-label="Rows per page:"
445+
readonly="readonly"
443446
type="text"
444447
autocomplete="on"
445448
aria-readonly="false"

test/unit/components/VTextField/__snapshots__/VTextField.spec.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ exports[`VTextField.js should apply theme to label, counter, messages and icons
2929
>
3030
foo
3131
</label>
32-
<input type="text"
33-
aria-label="foo"
32+
<input aria-label="foo"
33+
type="text"
3434
>
3535
</div>
3636
<div class="v-input__append-inner">

0 commit comments

Comments
 (0)