Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html in tab title attribute causes browser to show the html tag as tooltip #804

Closed
D3CK3R opened this issue Mar 15, 2014 · 4 comments
Closed
Milestone

Comments

@D3CK3R
Copy link

D3CK3R commented Mar 15, 2014

The title attribute should be removed from tabs after compile, because it causes the browser to show the tag as a tooltip.

<ion-tab data-title="<img src='{{user.logo}}' alt=''>" ng-click="e.stopPropagation()"></ion-tab>
@D3CK3R
Copy link
Author

D3CK3R commented Mar 15, 2014

Maybe we could also use a custom attribute for the html data to handle this issue.

@ajoslin ajoslin added this to the 1.0.0-beta.1 milestone Mar 15, 2014
@ajoslin ajoslin self-assigned this Mar 15, 2014
@ajoslin
Copy link
Contributor

ajoslin commented Mar 15, 2014

Thanks! will get to it before 1.0 :-)

@D3CK3R
Copy link
Author

D3CK3R commented Mar 17, 2014

Hey Andy, i've tried the latest build and the title tag isn't removed, any idea?

@BendingBender
Copy link

It is still possible that angular re-adds the title attribute if it contains interpolations. The following code for example:

<ion-tab title="{{'SOME-TITLE' | translate}}" ui-sref="somestate">
  <ion-nav-view name="some-tab"></ion-nav-view>
</ion-tab>

produces the following output:

<ion-tab
  icon="ui-icon ui-icon-shadow"
  ui-sref="somestate"
  href="#/someref"
  title="Some translated title">
</ion-tab>
<a
  ng-class="{'tab-item-active': isTabActive(), 'has-badge':badge, 'tab-hidden':isHidden()}"
  ng-disabled="disabled()"
  class="tab-item"
  icon="ui-icon ui-icon-shadow"
  title="Some translated title">
...
</a>

I've traced it down to the following line in compile.js in AngularJS.

A very easy workaround to not generate a visible title would be to change the line in tab.js to

attrStr('data-title', attr.title) +

which would generate something that the browser doesn't interpret, but I'm not sure whether it's a viable solution or just a hack.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants