md-tooltip documentation has invalid example
I am trying to use tooltip with icon, but seems that it is not working. Am I doing wrong? This is the example that I am using.
<md-icon md-svg-src="foo.svg" ng-if="type==foo">
<md-tooltip>This is Foo</md-tooltip>
</md-icon>
Thanks!
Yes, I understand how important a demo is. But, unfortunately, I couldn't do it because I only know using "md-icon" with URL, but I couldn't find a demo site supporting to read external image file. Do you have any idea how to create a demo for it?
At least, I tried to load angular material and show tooltip with button. http://jsfiddle.net/kimmoah/83yw8hws/
Thanks, Youngjin
ACTUAL PROBLEM: The documentation in tooltip.js has:
<md-icon icon="/img/icons/ic_play_arrow_24px.svg">
<md-tooltip>
Play Music
</md-tooltip>
</md-icon>
But it is not valid for md-icon to have any content (it works like an img tag).
@programmist -
Tooltips for icons make total sense. Since we do not replace the <md-icon> container, we could transclude the <md-tooltip> content.
@ThomasBurleson md-icon shouldn't do anything with content; it should behave just like an <img> element.
The UX of a icon button with a tooltip makes total sense. But that is really just implemented as:
<md-button>
<md-icon md-svg-src="your/icon.svg"></md-icon>
Action #1
<md-tooltip> My Action Tip</md-tooltip>
</md-button>
So let's mark this as will not fix issue.
The only drawback of wrapping in
That is a separate tooltip-related issue, which is tracked in #1968. It's worth noting that hover-only tooltips are bad UX for people who can't use the mouse or trackpad. It would be better to persist focus only for true keyboard interactions and exclude mouse clicks, a major pain with browsers but something we're working on for multiple components (buttons, checkboxes and radio buttons).
I could see a scenario where tooltip could optionally be applied as an attribute and behave as a decorator, but that may be beyond the scope of what was intended for tooltip.