Skip to content

Commit

Permalink
[Tooltip] Reduce surrounding margin
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-b-rose committed Aug 15, 2023
1 parent a36581b commit bc1f4aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/late-countries-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Reduced surrounding margin of Tooltip to allow for interaction with nearby UI elements.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ export class PositionedOverlay extends PureComponent<
preferredAlignment,
);

const chevronOffset = activatorRect.center.x - horizontalPosition;
const chevronOffset =
activatorRect.center.x -
horizontalPosition +
overlayMargins.horizontal * 2;

this.setState(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// stylelint-enable
position: relative;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
margin: var(--pc-tooltip-overlay-offset) var(--p-space-4) var(--p-space-4);
margin: var(--pc-tooltip-overlay-offset) var(--p-space-1) var(--p-space-1);
opacity: 1;
box-shadow: var(--p-shadow-lg);
// stylelint-disable-next-line -- Polaris component custom properties
Expand Down Expand Up @@ -106,7 +106,7 @@

.positionedAbove {
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
margin: var(--p-space-4) var(--p-space-4) var(--pc-tooltip-overlay-offset);
margin: var(--p-space-1) var(--p-space-1) var(--pc-tooltip-overlay-offset);
}

.Content {
Expand Down

0 comments on commit bc1f4aa

Please sign in to comment.