720kb / angular-tooltips

Angularjs tooltips module, add tooltips to your elements - https://720kb.github.io/angular-tooltips
351 stars 157 forks source link

Tip is not displayed when rendered twice #202

Open wearehappybits opened 7 years ago

wearehappybits commented 7 years ago

I have an interesting case, but maybe you will be aware about this.

I need to display some particular information twice. So I am using the same controller twice, just in different places. Almost everything is the same, but here is how tooltips html comes up:

<tooltip tooltip-template="We recommend to upload or select a larger image for best quality." tooltip-side="top" tooltip-size="small" class="tooltips custom-tooltip">
    <tip-cont><span ng-show="shownotification" class="icon-warning thumb-warn ng-scope" ng-mouseover="hoverOnNotification()" ng-mouseleave="hoverOffNotification()"></span></tip-cont>
    <tip class="_hidden">
        <tip-tip><span class="close-button">×</span>We recommend to upload or select a larger image for best quality.</tip-tip>
        <tip-arrow></tip-arrow>
    </tip>
</tooltip>

<!-- tooltips:  -->
<tooltip tooltip-template="We recommend to upload or select a larger image for best quality." tooltip-side="top" tooltip-size="small" class="tooltips custom-tooltip _top _steady _ready">
    <tip-cont><span ng-show="shownotification" class="icon-warning thumb-warn ng-scope ng-hide" ng-mouseover="hoverOnNotification()" ng-mouseleave="hoverOffNotification()" aria-hidden="true"></span></tip-cont>
    <tip class="">
        <tip-tip class="_small"><span class="close-button" style="display: none;">×</span>We recommend to upload or select a larger image for best quality.</tip-tip>
        <tip-arrow></tip-arrow>
    </tip>
</tooltip>

 One is displayed correctly (second one in the DOM). The first one for some reason gets this:    <tip class="_hidden">

Any idea on why this happens or where I could look to dig deeper?

Thanks.

wearehappybits commented 7 years ago

So, I got it narrowed but still can not find the exact issue. To be short I am adding on the same class (same name) twice. And it only renders once.

45kb commented 7 years ago

@wearehappybits Hi, can you show the html you wrote? (not the html generated by the tooltip) thanks.