[Tooltip] Tooltip should automatically determine position
See original GitHub issueBug, feature request, or proposal:
Feature request : tooltip auto positionning
What is the expected behavior?
mdTooltip linked to
<md-icon-button>
with no tooltipPosition defined
should position automatically based on the given space,
or at least automatically setup its tooltipPosition
What is the current behavior?
Default tooltip shows up below the element and overflows the screen
What are the steps to reproduce?
Add a tooltip to a <md-icon-button>
on the edge of your screen
Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: https://goo.gl/DlHd6U Plunker
What is the use-case or motivation for changing an existing behavior?
Avoid developpers handling themselves the edge case with approximate ElementRef manipulation.
Which versions of Angular, Material, OS, browsers are affected?
“@angular/material”: “^2.0.0-beta.2”
Is there anything else we should know?
I found my way getting around this issue, by manipulating ElementRef after the view is initialized :
ngAfterViewInit() {
if(this.elRef.nativeElement.offsetLeft === 0){
this.tooltipPosition = "right";
}
}
I’m not used to angular2 dom manipulations, any better option would be highly appreciated
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:6 (2 by maintainers)
Top GitHub Comments
Auto positioning so the tooltip will display on screen is a feature I know our team will be needing at some point in the near future.
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.