-
Notifications
You must be signed in to change notification settings - Fork 3.4k
mdTooltip: Aria-label added for md-tooltip but not interpolated. #6855
Comments
@marcysutton do you know anything about tooltip aria-labels ? |
I just stumbled upon this issue, too. Would be nice if it gets fixed. As a workaround one can add the aria-label attribute on the parent manually with the same (interpolated) value, though that's quite some work and duplication if there are lots of tooltips... |
Text put into a tooltip is copied to a parent button element so it has text in it when the user focuses on the button...waiting for the tooltip to show wouldn't guarantee enough time for assistive technology to catch it. The demos show @oemmes which parent element are you putting it on? The |
Compiling it would be a bad idea- that could lead to xss. Using |
@marcysutton I'm using the tooltip for an md-button, so I put the aria-label on md-button like this: <md-button aria-label="{{'configurator.actions.share' | translate}}" class="md-fab md-raised" ng-click="shareArticle()">
<md-tooltip>{{'configurator.actions.share' | translate}}</md-tooltip>
<md-icon class="icon icon-share"></md-icon>
</md-button> On the other hand it would be nice if one could use md-tooltip as an attribute on an (focusable) element which has a title or an aria-label attribute. md-tooltip would fetch the title or aria-label and create the tooltip for it. Markup could be then: <md-button aria-label="{{'configurator.actions.share' | translate}}" md-tooltip class="md-fab md-raised" ng-click="shareArticle()">
<md-icon class="icon icon-share"></md-icon>
</md-button> |
Additional report from @kbae00
|
…-label Fixes the raw tooltip text text being added to the parent, if a tooltip contained a data binding, instead of the interpolated value. Fixes angular#6855.
…-label Fixes the raw tooltip text text being added to the parent, if a tooltip contained a data binding, instead of the interpolated value. Fixes angular#6855.
md-tooltip adds an aria-label to the element (source), but if the text in the md-tooltip is
{{ text }}
, the aria-label is also set to{{ text }}
. When the text is displayed in the tooltip, it's correctly interpolated, but the aria-label is still wrong.The text was updated successfully, but these errors were encountered: