Skip to content

Commit

Permalink
feat(Menu,Select): use proper Overlay primitive (#1527)
Browse files Browse the repository at this point in the history
## πŸ“ Changes

- Tooltips and Selects were using OverlayContainer instead of Overlay
which was causing them not to work right in modals and drawers

## βœ… Checklist

Easy UI has certain UX standards that must be met. In general,
non-trivial changes should meet the following criteria:

- [ ] ~Visuals match Design Specs in Figma~
- [ ] ~Stories accompany any component changes~
- [x] Code is in accordance with our style guide
- [ ] ~Design tokens are utilized~
- [ ] ~Unit tests accompany any component changes~
- [ ] ~TSDoc is written for any API surface area~
- [ ] ~Specs are up-to-date~
- [x] Console is free from warnings
- [x] No accessibility violations are reported
- [x] Cross-browser check is performed (Chrome, Safari, Firefox)
- [x] Changeset is added

~Strikethrough~ any items that are not applicable to this pull request.
  • Loading branch information
stephenjwatkins authored Dec 12, 2024
1 parent 1b92cc0 commit e33439e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-mice-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@easypost/easy-ui": patch
---

fix(Select,Tooltip): use proper Overlay primitive
6 changes: 3 additions & 3 deletions easy-ui-react/src/Select/SelectOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import {
DismissButton,
OverlayContainer,
Overlay,
mergeProps,
useListBox,
usePopover,
Expand Down Expand Up @@ -68,7 +68,7 @@ function SelectOverlayContent() {
} as React.CSSProperties;

return (
<OverlayContainer>
<Overlay>
<div {...underlayProps} className={styles.underlay} />
<div
{...mergeProps(popoverProps, { style })}
Expand Down Expand Up @@ -104,6 +104,6 @@ function SelectOverlayContent() {
</div>
<DismissButton onDismiss={selectState.close} />
</div>
</OverlayContainer>
</Overlay>
);
}
6 changes: 3 additions & 3 deletions easy-ui-react/src/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, {
useLayoutEffect,
} from "react";
import {
OverlayContainer,
Overlay,
Placement,
mergeProps,
useOverlayPosition,
Expand Down Expand Up @@ -129,14 +129,14 @@ export function Tooltip(props: TooltipProps) {
ref: triggerRef,
})}
{tooltipTriggerState.isOpen && (
<OverlayContainer>
<Overlay>
<TooltipInner
{...props}
triggerRef={triggerRef}
tooltipPropsFromTrigger={tooltipPropsFromTrigger}
tooltipTriggerState={tooltipTriggerState}
/>
</OverlayContainer>
</Overlay>
)}
</>
);
Expand Down

0 comments on commit e33439e

Please sign in to comment.