-
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
refactor(tooltip): avoid calc inside transform
for IE support
#3739
refactor(tooltip): avoid calc inside transform
for IE support
#3739
Conversation
Deploy preview for the-carbon-components ready! Built with commit cf3a9fd https://deploy-preview-3739--the-carbon-components.netlify.com |
Deploy preview for carbon-elements ready! Built with commit cf3a9fd |
Deploy preview for carbon-components-react ready! Built with commit cf3a9fd https://deploy-preview-3739--carbon-components-react.netlify.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks that you figured out! 🎉 Thank alot @emyarod for doing this!
@asudoh any thoughts on the |
@emyarod Thank you for double-checking, either way is fine. I'd choose "all browsers" solution if it's straightforward, and choose IE-override solution otherwise. |
@emyarod Should we go ahead with this PR or do you still have some open questions...? Thanks! |
@asudoh I will add IE overrides so that we can continue to use |
a2725c8
to
d618545
Compare
tooltip width is now hard coded for IE, so users will have to modify that to fit their tooltip content on IE |
@emyarod Thank you for the update - The latest code LGTM 👍, do you think this PR is ready to go? |
@asudoh yes if IE looks good for the reviewers as well |
@carbon-design-system/design does this look good? |
@emyarod Is this refactor supposed to not change the design/behavior? There are some changes to the tooltips from a quick look – is this PR supposed to change how alignments are done? If not calculated, how are the triangles going to line up to "start, center, end"? Eg. below screenshot is supposed to be end alignment, but is not correct: |
@shixiedesign this is a refactor, so the behavior is identical to what we settled on previously. IIRC we decided the caret would always be centered and the alignment would only affect the tooltip body
the result of our discussion #2748 (comment) |
912c9da
to
5f99102
Compare
@vincentsnagg got it, I was testing on Chromium Edge but I just added a feature query for Edge 12-15 and 16 |
@shixiedesign Thank you for doing the design review! Does the latest comment from @emyarod make sense? Probably if something has to be changed from UX perspective we can enter a new issue to track it...? |
bb57856
to
ee8aa15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. My mistake confusing definition tooltip & icon tooltip. This looks consistent with current behavior. Thanks!
Closes #3671
Related: #2781, #3115, #3151
This PR refactors tooltip positioning logic to avoid
calc()
usage inside of CSStransform
(https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/104773/). We now use a combination of TRBL positioning and CSS transforms rather than relying solely on CSS transforms.We use explicit
rem
values for TRBL positioning (dictated by the spec), and we use percentage values to further translate the position of the tooltip caret and body depending on the desired position and alignmentChangelog
New
display
Changed
transform
to TRBL +transform
)transform
to TRBL +transform
)Removed
initial
andmax-content
values in IETesting / Reviewing
Ensure tooltips appear correct on all platforms and all existing use cases (including password input, icon-only button)
Regarding the point made by @tw15egan in the issue, we have a few options WRT
width: max-content
usage:we can either apply a workaround for all browsers or add IE specific rules (I guess this is progressive enhancement vs graceful degradation?)