-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(input): duplicate placeholders and data bindings aria-label #8291
Conversation
// expressions in the placeholder to be evaluated. | ||
$mdUtil.nextTick(function() { | ||
$mdAria.expect(element, 'aria-label', element.attr('placeholder')); | ||
}, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next tick timeout is not necessary.
if (!containerCtrl.label) {
$mdAria.expect(element, 'aria-label', attr.placeholder);
}
Using the interpolated attribute is working as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so too, but try looking at the aria-label
on the fiddle from the issue: https://codepen.io/leocaseiro/pen/GZYZxr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh it works fine for me, when I checked out your changes and modified it to attr.placeholder
.
Patched: http://codepen.io/DevVersion/pen/reQepZ
HEAD: http://codepen.io/DevVersion/pen/BKGKYp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't notice that you used the attr
object, I'll give it a shot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, works the same. I'll update the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, no problem, thanks for giving a shot ;)
@crisbeto - please rebase. |
* Fixes the element label being duplicated, if it has a data binding in the placeholder attribute. This was caused by Angular re-adding the placeholder attribute, even though it was removed by the Material placeholder directive. * Fixes the aria-label getting the raw data binding (e.g. `aria-label="{{expression}}"`), when it's gets taken from a dynamic placeholder. Fixes angular#8251. Fixes angular#8377.
Done @ThomasBurleson |
aria-label="{{expression}}"
), when it's gets taken from a dynamic placeholder.Fixes #8251.
Fixes #8377.