primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Tooltip fails on some elements

Open Elanor-L opened this issue 10 years ago • 0 comments

Hi, I tried to put a tooltip on a button, but it doesn't really work: I mean sometimes it works, and sometimes it doesn't. On the first hover, I got this error

platform-browser.umd.js:1900 TypeError: Cannot read property 'style' of null
    at Tooltip.hide (tooltip.ts:89)
    at Tooltip.onMouseLeave (tooltip.ts:32)
    at AppView._View_WorkDataFormComponent0._handle_mouseout_107_7 (WorkDataFormComponent.template.js:2058)
    at eval (platform-browser.umd.js:2645)
    at eval (platform-browser.umd.js:2722)
    at ZoneDelegate.invoke (zone.js:323)
    at Object.onInvoke (core.umd.js:9100)
    at ZoneDelegate.invoke (zone.js:322)
    at Zone.runGuarded (zone.js:230)
    at NgZoneImpl.runInnerGuarded (core.umd.js:9133)
    at NgZone.runGuarded (core.umd.js:9365)

Here the generated code

<button _ngcontent-obc-20="" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" icon="fa-pencil-square-o" pbutton="" ptooltip="Modifier" tooltipposition="top">
    <span class="ui-button-icon-left ui-c fa fa-fw fa-pencil-square-o"/>
    <span class="ui-button-text ui-c">ui-button</span>
</button>

The error occurs when the cursor moves from an element to his child. I think the trouble comes from this fact that all the elements of the button have the event of the tooltip.

Elanor-L avatar Jul 28 '16 09:07 Elanor-L