-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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(react-component): ensure tooltips are fully visible by adding padding #18883
base: main
Are you sure you want to change the base?
fix(react-component): ensure tooltips are fully visible by adding padding #18883
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #18883 +/- ##
=======================================
Coverage 84.88% 84.88%
=======================================
Files 396 396
Lines 14512 14512
Branches 4738 4773 +35
=======================================
Hits 12319 12319
Misses 2044 2044
Partials 149 149 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hey @heloiselui, I can see that the components are correctly placed in Storybook on my end. I'm not sure if adding padding is necessary, especially for the Tooltip components, as I don't notice any difference after the changes. Let's discuss this PR in tomorrow's review call. |
Hey @preetibansalui the component gets clipped off when you Now this is how stackblitz look after this PR |
Ah, I see now. Thanks for the clarification @riddhybansal! Wondering if |
Umm yeah but |
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 good! Small thing – some of the inline styles can be added to decorators
so they don't show up in the MDX source code panel.
@@ -89,7 +89,7 @@ export const ExperimentalAutoAlign = () => { | |||
|
|||
export const Default = (args) => { | |||
return ( | |||
<> | |||
<div style={{ padding: '3rem' }}> |
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.
This can be moved to the story decorators
at the end of this file
Default.story = {
decorators: [
(story) => (
<div
style={{
display: 'flex',
alignItems: 'center',
+ padding: '3rem',
}}>
{story()}
</div>
),
],
};
<Help /> | ||
</button> | ||
</Tooltip> | ||
<div style={{ padding: '9rem' }}> |
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.
This can be moved to the Default decorators
.
decorators: [
(Story, context) => {
if (context.name.toLowerCase().includes('auto align')) {
return <Story />;
}
return (
- <div className="sb-tooltip-story">
+ <div style={{ padding: '9rem' }} className="sb-tooltip-story">
<Story />
</div>
);
Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com>
…ories.js" This reverts commit edbebee.
Hey @kennylam! I tried using your suggestion with decorators, which I agree is a cleaner solution, but unfortunately it doesn’t work in StackBlitz since decorators aren’t applied there. |
I agree that autoAlign is currently an experimental prop, so it shouldn't be set as the default. Let's hold off on incorporating it until it becomes stable. Once it's finalized, we can update the stories to use autoAlign in place of padding. For now, we can continue using padding as the default or decorators if its working fine for stackblitz . |
Closes #18661
Ensures tooltips are fully visible by adding padding to components affected by layout inconsistencies. This prevents tooltips from being clipped in StackBlitz.
Changelog
New
CopyButton
,Toggletip
, andTooltip
to prevent tooltips from being cut off.Changed
<div>
with appropriatepadding
(3rem
to9rem
, depending on the component).Testing / Reviewing
CopyButton
(Default)Toggletip
(Default)Tooltip
(Default and Duration)