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] Tooltip does not position correctly with long message #3721

Closed
impankratov opened this issue Mar 22, 2017 · 6 comments
Closed

[Tooltip] Tooltip does not position correctly with long message #3721

impankratov opened this issue Mar 22, 2017 · 6 comments
Assignees
Labels
area: material/tooltip P4 A relatively minor issue that is not relevant to core functions

Comments

@impankratov
Copy link

Bug, feature request, or proposal:

bug

What is the expected behavior?

Tooltip should be positioned to the left of the md-fab button

What is the current behavior?

Tooltip overlaps the fab button:
0103d24c-0f2b-11e7-8d6f-b288502cb5f5

What are the steps to reproduce?

Tried to create fixed md-fab button in the right bottom corner:
https://plnkr.co/edit/gkr0cO

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, browsers are affected?

Is there anything else we should know?

If I change mdTooltipPosition="left" to mdTooltipPosition="above" - tooltips will be positioned correctly.
Shorter tooltip messages are working correctly.

@Goodwine
Copy link

I had to add a css rule that sets a max width to the tooltip text and makes it break into several lines, it worked really well but it's fragile and may not work for you :(

@impankratov
Copy link
Author

@Goodwine sounds interesting, maybe we can use this to make a PR? Can you share the code?

@Goodwine
Copy link

Goodwine commented Apr 4, 2017

I don't think the CSS changes would work for everyone, it's very hacky. In fact, per the material guide, the tooltip shouldn't be that long to begin with.

If you really want to do this hack, you could update your stylesheets and set custom rules on .mat-tooltip like a max-width that works for you and whether you want to show an ellipsis on the text, or reset height so that it can grow vertically.

Again, those things go against the material guide, so be mindful of that.

@jelbourn jelbourn added the P4 A relatively minor issue that is not relevant to core functions label Jun 6, 2017
@andrewseguin andrewseguin changed the title Tooltip positioning bug while using long message [Tooltip] Tooltip does not position correctly with long message Oct 19, 2017
@kpaxton
Copy link

kpaxton commented Aug 16, 2018

This is related to #2671 and I just commented on that one that this doesn't work. The tooltip already has a max-width property set based on the outcome of that ticket. It needs to perform the way the MatMenu does and reposition itself.

@jelbourn
Copy link
Member

jelbourn commented Apr 2, 2021

I tried this with the latest version and AFAICT the behavior seems correct, seems to have been fixed since this issue was reported
https://stackblitz.com/edit/angular-xp2yxk?file=src%2Fapp%2Ftooltip-auto-hide-example.html

@jelbourn jelbourn closed this as completed Apr 2, 2021
@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 May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/tooltip P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

5 participants