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(tooltip): tooltip margin bug #8461

Merged
merged 15 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/components/src/components/tooltip/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@
}

&[data-floating-menu-direction='left'] {
margin-left: calc(#{$spacing-03} * -1);

.#{$prefix}--tooltip__caret {
top: 50%;
// left position has an additional space between caret and tooltip
Expand All @@ -510,6 +512,8 @@
}

&[data-floating-menu-direction='top'] {
margin-top: calc(#{$spacing-03} * -1);

.#{$prefix}--tooltip__caret {
top: auto;
bottom: calc(#{$caret-size * (-1)} + 1px);
Expand All @@ -518,13 +522,19 @@
}

&[data-floating-menu-direction='right'] {
margin-left: $spacing-03;

.#{$prefix}--tooltip__caret {
top: 50%;
right: auto;
left: calc(#{$caret-size * (-1)} + 1px);
transform: rotate(270deg) translate(50%, -50%);
}
}

&[data-floating-menu-direction='bottom'] {
margin-top: $spacing-03;
}
}

.#{$prefix}--tooltip__heading {
Expand All @@ -535,6 +545,7 @@

.#{$prefix}--tooltip--shown {
display: block;
margin-top: 0;
}

// Tooltip Definition
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/internal/FloatingMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ class FloatingMenu extends React.Component {
...styles,
...positioningStyle,
position: 'absolute',
margin: 0,
opacity: 1,
},
});
Expand Down