Skip to content
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

fix: definition tooltip breaks with large text #17964

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

preetibansalui
Copy link
Contributor

Closes #17848

Definition Tooltip breaks with large text

Changelog

  1. Update default align value to bottom instead of bottom-start
  2. Added autoAlign prop

Testing / Reviewing

  1. Go to Storybook > Definition Tooltip > Default
  2. Hover on text, it should open the tooltip.

Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 55dbdb0
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/672c426371ca91000870ea60
😎 Deploy Preview https://deploy-preview-17964--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 55dbdb0
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/672c4263ba65ef000886f32c
😎 Deploy Preview https://deploy-preview-17964--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 55dbdb0
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/672c42630cd7fd0008e48349
😎 Deploy Preview https://deploy-preview-17964--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.82%. Comparing base (cdc8db7) to head (55dbdb0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17964   +/-   ##
=======================================
  Coverage   81.82%   81.82%           
=======================================
  Files         404      404           
  Lines       14067    14067           
  Branches     4360     4380   +20     
=======================================
  Hits        11510    11510           
+ Misses       2395     2394    -1     
- Partials      162      163    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@2nikhiltom 2nikhiltom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@Gururajj77 Gururajj77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@guidari
Copy link
Contributor

guidari commented Nov 5, 2024

@preetibansalui
I just have one question regarding alignment, and maybe we can involve design.
I feel like the caret should always stay centered on the trigger element, but with auto-align, that’s not the case. The caret’s position is instead based on the text length within the definition tooltip.

Other than that, the fix looks good to me.

Screenshot 2024-11-05 at 09 47 04

@guidari guidari requested review from a team and laurenmrice and removed request for a team November 5, 2024 12:52
@preetibansalui
Copy link
Contributor Author

@preetibansalui I just have one question regarding alignment, and maybe we can involve design. I feel like the caret should always stay centered on the trigger element, but with auto-align, that’s not the case. The caret’s position is instead based on the text length within the definition tooltip.

Other than that, the fix looks good to me.

Screenshot 2024-11-05 at 09 47 04

That autoAlign is an optional prop so depends on user in what condition they want to make it on.

Copy link
Member

@laurenmrice laurenmrice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@preetibansalui When the autoAlign prop is set to True, the "bottom" alignment looks fine, but the "bottom-left" and "bottom-right" caret is visually off. I also think that if the user is choosing a "bottom-left" or "bottom-right" alignment, the tooltip container needs to be vertically flush with the definition text depending on which alignment is being used.

Definition tooltip (auto align_ true)
  • Also unrelated, but there seems to be some more spacing alignment bugs with some of the alignment options that is unrelated to this PR, and I can make a separate issue for that in our repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Definition tooltip : tooltip and the caret icon is not aligned when used in larger texts
5 participants