-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 is not browser aware and is clipped #4909
Comments
Recommended to introduce alignment options like definition/icon tooltips, in case interactive tooltip does not have one. |
@asudoh what is the recommendation to detect when placement needs to be updated? Like, in this case, we'd want to move it to the right when the browser becomes small or if viewing from a mobile device. |
Just in case my above commend was not clear enough; Definition/icon tooltip has alignment options so that tooltip caret can be positioned at the left/right of the tooltip body so the the left of tooltip body is close or aligned to the trigger button/icon, etc. |
Right, I follow that there are alignment options for tooltips. My question was around how would a user understand that the current alignment option would be clipped by the browser due to its placement and update it dynamically 👍 |
I wouldn't recommend OOTB automatic alignment option due to the complexity around it. It may be different for PALs/applications using Carbon. |
I definitely understand if we don't want to do this out-of-the-box, I'm curious what we would recommend to teams then who are encountering this issue. |
No recommendation in particular; PALs/applications can use regular techniques to detect element positions/sizes. |
I am also having this issue |
Can we add this as an optional feature? Like it's implemented but it won't be turned on unless we specify that it does via some attribute. I can see this being really useful in a lot of situations. If the tooltip goes out of bound on the left, move the placement to the right. If it goes out of bounds on the bottom side, move it to the top and vice versa. |
@asudoh is there a chance that https://react.carbondesignsystem.com/?path=/story/tooltip--default-bottom will adopt the same alignment options as https://react.carbondesignsystem.com/?path=/story/tooltipdefinition--default ? right now it seems like we don't have control over the interactive one |
The effort is tracked separately at #3837. |
This issue no longer exists. Closing. :) |
When visiting a tooltip example that runs to the edge of the screen, we observe this behavior:
This issue is to determine whether or not we need to make the tooltip positioning browser-aware or if there is another solution we could use that would not clip the text in the tooltip.
The text was updated successfully, but these errors were encountered: