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(lemon-ui): Make popovers/dropdowns snappy #18280

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all 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: 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
Loading