Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions paper-textarea.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
disabled$="[[disabled]]"
invalid="[[invalid]]">

<label hidden$="[[!label]]" aria-hidden="true" for="input" slot="label">[[label]]</label>
<label hidden$="[[!label]]" aria-hidden="true" slot="label">[[label]]</label>

<iron-autogrow-textarea id="input" class="paper-input-input" slot="input"
aria-labelledby$="[[_ariaLabelledBy]]"
label="[[label]]"
aria-describedby$="[[_ariaDescribedBy]]"
bind-value="{{value}}"
invalid="{{invalid}}"
Expand Down Expand Up @@ -100,11 +100,6 @@
],

properties: {
_ariaLabelledBy: {
observer: '_ariaLabelledByChanged',
type: String
},

_ariaDescribedBy: {
observer: '_ariaDescribedByChanged',
type: String
Expand Down Expand Up @@ -136,10 +131,6 @@
}
},

_ariaLabelledByChanged: function(ariaLabelledBy) {
this.$.input.textarea.setAttribute('aria-labelledby', ariaLabelledBy);
},

_ariaDescribedByChanged: function(ariaDescribedBy) {
this.$.input.textarea.setAttribute('aria-describedby', ariaDescribedBy);
},
Expand Down
6 changes: 3 additions & 3 deletions test/paper-textarea.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@

suite('a11y', function() {

test('has aria-labelledby', function() {
test('has aria-label', function() {
var input = fixture('label');
assert.isTrue(input.inputElement.textarea.hasAttribute('aria-labelledby'))
assert.equal(input.inputElement.textarea.getAttribute('aria-labelledby'), Polymer.dom(input.root).querySelector('label').id, 'aria-labelledby points to the label');
assert.isTrue(input.inputElement.textarea.hasAttribute('aria-label'))
assert.equal(input.inputElement.textarea.getAttribute('aria-label'), input.label, 'paper-textarea passes through label to aria-label');
});

test('has aria-describedby for error message', function(done) {
Expand Down