Skip to content

Commit 64cc851

Browse files
heloiseluikennylampreetibansalui
authored
fix(react-component): ensure tooltips are fully visible by adding padding (#18883)
* fix(copybutton): ensure tooltips are fully visible by adding padding * fix(toggletip): ensure tooltips are fully visible by adding padding * fix(tooltip): ensure tooltips are fully visible by adding padding * Update packages/react/src/components/CopyButton/CopyButton.stories.js Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com> * Revert "Update packages/react/src/components/CopyButton/CopyButton.stories.js" This reverts commit edbebee. * fix: ensure tooltips are visible in StackBlitz using autoAlign * fix(tooltip): ensure tooltip are visible in StackBlitz using autoAlign --------- Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com> Co-authored-by: Preeti Bansal <146315451+preetibansalui@users.noreply.github.com>
1 parent 702815a commit 64cc851

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

packages/react/src/components/CopyButton/CopyButton.stories.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export default {
2020
},
2121
};
2222

23-
export const Default = (args) => <CopyButton {...args} />;
23+
// Note: autoAlign is used here only to make tooltips visible in StackBlitz,
24+
// autoAlign is experimental and not part of the actual implementation.
25+
export const Default = (args) => <CopyButton autoAlign {...args} />;
2426

2527
Default.argTypes = {
2628
className: {

packages/react/src/components/Toggletip/Toggletip.stories.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ export const ExperimentalAutoAlign = () => {
8787
);
8888
};
8989

90+
// Note: autoAlign is used here only to make tooltips visible in StackBlitz,
91+
// autoAlign is experimental and not part of the actual implementation.
9092
export const Default = (args) => {
9193
return (
9294
<>
9395
<ToggletipLabel>Toggletip label</ToggletipLabel>
94-
<Toggletip {...args}>
96+
<Toggletip autoAlign {...args}>
9597
<ToggletipButton label="Show information">
9698
<Information />
9799
</ToggletipButton>

packages/react/src/components/Tooltip/Tooltip.stories.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ export default {
5151
],
5252
};
5353

54+
// Note: autoAlign is used here only to make tooltips visible in StackBlitz,
55+
// autoAlign is experimental and not part of the actual implementation.
5456
export const Default = (args) => {
5557
const label =
5658
'Occasionally, services are updated in a specified time window to ensure no down time for customers.';
5759
return (
58-
<Tooltip label={label} closeOnActivation={false} {...args}>
60+
<Tooltip autoAlign label={label} closeOnActivation={false} {...args}>
5961
<button className="sb-tooltip-trigger" type="button">
6062
<Help />
6163
</button>
@@ -130,9 +132,11 @@ export const ExperimentalAutoAlign = () => {
130132
);
131133
};
132134

135+
// Note: autoAlign is used here only to make tooltips visible in StackBlitz,
136+
// autoAlign is experimental and not part of the actual implementation.
133137
export const Duration = () => {
134138
return (
135-
<Tooltip label="Label one" enterDelayMs={0} leaveDelayMs={300}>
139+
<Tooltip autoAlign label="Label one" enterDelayMs={0} leaveDelayMs={300}>
136140
<Button>This button has a tooltip</Button>
137141
</Tooltip>
138142
);

0 commit comments

Comments
 (0)