Tooltip: position is not dynamic enough
See original GitHub issueTooltip: position is not dynamic enough and it will display beyond the edge of screen
Detailed description
Describe in detail the issue you’re having.
we use the default position on the tooltip component, which make the tooltip coming below the trigger element. problem comes when the trigger element is at the bottom of the screen and the tooltip will render partially outside of the edge.
- we don’t want to provide scroll bar for the
body
element. - the trigger element is dynamic meaning its position will change during its lifecycle (vertical scroll etc)
Is this a feature request (new component, new icon), a bug, or a general issue?
Bug
Is this issue related to a specific component?
Yes, tooltip
What did you expect to happen? What happened instead? What would you like to see changed?
I expect the tooltip is somehow smarter to calculate its available space and switch to display to the opposite side of the trigger element.
What browser are you working in?
IE 11 and above, Firefox, Chrome
What version of the Carbon Design System are you using?
“carbon-components”: “^7.0.0” “carbon-components-react”: “^5.19.0”,
What offering/product do you work on? Any pressing ship or release dates we should be aware of?
Information governance catalog/Unified governence
Steps to reproduce the issue
Sandbox: https://codesandbox.io/s/1znmwy5kx7
IBM github issue: https://github.ibm.com/InformationServer/igc-ui-react/issues/2220
Additional information
can provide more information if the issue link above doesn’t have enough
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (9 by maintainers)
Top GitHub Comments
@asudoh Thanks for the promptly reply. the sanbox example just to to show the tooltip will go out of bound. For our case, the position of the the trigger element is unknown until rendered. and even then, the trigger element will still be moving around with some scrolling. Basically I am trying to say that it’s unknown at design time where the element is going to be.
Allow us to try your suggestion any way to see if we can get a compromise. In the meanwhile, if you don’t mind, I’d like to keep this issue open
As there’s been no activity since this issue was marked as stale, we are auto-closing it.