Skip to content

Commit

Permalink
fix(lemon-ui): Make popovers/dropdowns snappy
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Oct 30, 2023
1 parent 211aeb2 commit 47bf6d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions frontend/src/lib/lemon-ui/Popover/Popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

.Popover__box {
position: relative; // For arrow
transition: opacity 100ms ease, transform 100ms ease;
transition: opacity 50ms ease, transform 50ms ease;
transform-origin: top;
box-shadow: var(--shadow-elevation);
background: var(--bg-light);
Expand Down Expand Up @@ -75,21 +75,22 @@
}

.Popover[data-placement^='bottom'] & {
transform: rotateX(-12deg);
transform: rotateX(-6deg);
}

.Popover[data-placement^='top'] & {
transform: rotateX(12deg);
transform: rotateX(6deg);
}

.Popover[data-placement^='left'] & {
transform: rotateY(-12deg);
transform: rotateY(-6deg);
}

.Popover[data-placement^='right'] & {
transform: rotateY(12deg);
transform: rotateY(6deg);
}

.Popover.Popover--enter-active &,
.Popover.Popover--enter-done & {
opacity: 1;
transform: none;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/lemon-ui/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const Popover = React.forwardRef<HTMLDivElement, PopoverProps>(function P
</PopoverReferenceContext.Provider>
)}
<FloatingPortal root={getPopupContainer?.()}>
<CSSTransition in={visible} timeout={100} classNames="Popover-" appear mountOnEnter unmountOnExit>
<CSSTransition in={visible} timeout={50} classNames="Popover-" appear mountOnEnter unmountOnExit>
<PopoverOverlayContext.Provider value={[visible, currentPopoverLevel]}>
<div
className={clsx(
Expand Down

0 comments on commit 47bf6d8

Please sign in to comment.