question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tooltip: position is not dynamic enough

See original GitHub issue

Tooltip: 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.

  1. we don’t want to provide scroll bar for the body element.
  2. 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:closed
  • Created 5 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
nelsonchen90commented, Mar 30, 2018

@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

0reactions
stale[bot]commented, Jun 11, 2019

As there’s been no activity since this issue was marked as stale, we are auto-closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamically position css tooltip - Stack Overflow
I'm afraid that CSS does not allow you to detect tooltip's position, and because of that, you can't make dynamic alignments using pure...
Read more >
Building a simple tooltip component that never goes off screen
There are clever solutions to handle dynamic positioning for elements to always stay visible on screens, such as Popper.js. However, ~6Kb of ...
Read more >
Dynamic Tooltip in Unity! (Resizable, Follows Mouse, Edge ...
Get the Project files and Utilities at https://unitycodemonkey.com/video.php?v=YUIohCXt_pcLet's build a Dynamic Tooltip that can resize ...
Read more >
Position in JavaScript Tooltip control - Syncfusion
Dynamic positioning ​​ The Tooltip and its tip pointer can be positioned dynamically based on the target's location. This can be achieved by...
Read more >
Tooltips - Windows apps | Microsoft Learn
By default, a ToolTip is displayed centered above the pointer. The placement is not constrained by the app window, so the ToolTip might...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found