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

Tooltip doesn't work on button with md-mini-fab #1959

Closed
skined90 opened this issue Nov 22, 2016 · 8 comments
Closed

Tooltip doesn't work on button with md-mini-fab #1959

skined90 opened this issue Nov 22, 2016 · 8 comments

Comments

@skined90
Copy link

Tooltip doesn't work on button with md-mini-fab. I'm getting the error:

error_handler.js:54 TypeError: Cannot read property 'originX' of undefined
at new ConnectionPositionPair (connected-position.js:5)
at ConnectedPositionStrategy.withFallbackPosition (connected-position-strategy.js:78)
at new ConnectedPositionStrategy (connected-position-strategy.js:27)
at OverlayPositionBuilder.connectedTo (overlay-position-builder.js:30)
at MdTooltip._createOverlay (tooltip.js:116)
at MdTooltip._createTooltip (tooltip.js:104)
at MdTooltip.show (tooltip.js:77)
at _View_MyWatchlistComponent1._handle_mouseenter_25_0 (component.ngfactory.js:654)
at view.js:375
at dom_renderer.js:262
at dom_events.js:30
at ZoneDelegate.invoke (zone.js:232)
at Object.onInvoke (ng_zone.js:238)
at ZoneDelegate.invoke (zone.js:231)
at Zone.runGuarded (zone.js:128)
at NgZone.runGuarded (ng_zone.js:133)
at HTMLButtonElement.outsideHandler (dom_events.js:30)
at ZoneDelegate.invokeTask (zone.js:265)
at Zone.runTask (zone.js:154)
at HTMLButtonElement.ZoneTask.invoke (zone.js:335)

@crisbeto
Copy link
Member

Could you post a code sample @skined90? It works fine for me:

a

@skined90
Copy link
Author

Sorry, I've made a mistake. I wrote tooltip-position 'top' instead of 'above'

@crisbeto
Copy link
Member

Thanks for getting back. It may still be a good idea to show a more helpful error message if the position is something unexpected.

@skined90
Copy link
Author

@crisbeto Can you please how you made tooltip to hide immediately after mouseleave because in my case it stays active for ~1 second.

@crisbeto
Copy link
Member

I'm pretty sure I copied it off the tooltip demo page. Should be something like this:

<button md-mini-fab [md-tooltip]="'message'"></button>

@skined90
Copy link
Author

@crisbeto Hm. Weird. I did the same and it definitely doesn't work same as yours.

@crisbeto
Copy link
Member

Here's the exact HTML that I used:

<button md-mini-fab [md-tooltip]="message">
  <md-icon class="md-24">check</md-icon>
</button>

Are you using the latest Material version? Note that I'm testing against master.

crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 25, 2016
* Throws a more informative error message when an invalid position is passed to the tooltip. Previously it would throw something along the lines of `Cannot read property 'originX' of undefined`.
* Moves the various tooltip switch statements to use an enum for easier validation.

Referencing angular#1959.
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 6, 2016
* Throws a more informative error message when an invalid position is passed to the tooltip. Previously it would throw something along the lines of `Cannot read property 'originX' of undefined`.
* Moves the various tooltip switch statements to use an enum for easier validation.

Referencing angular#1959.
mmalerba pushed a commit that referenced this issue Dec 7, 2016
…#1986)

* Throws a more informative error message when an invalid position is passed to the tooltip. Previously it would throw something along the lines of `Cannot read property 'originX' of undefined`.
* Moves the various tooltip switch statements to use an enum for easier validation.

Referencing #1959.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
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

2 participants