Skip to content

Commit d01f413

Browse files
authored
fix(nav): Use mode='popLayout' for nav preview animation (#98248)
Changes the AnimatePresence mode from `wait` to `popLayout`. This should fix some rare issues where AnimatePresence gets "stuck", which seemed to occur when quickly previewing other nav items. `popLayout` will animate the new sidebar content immediately so it works a bit better for high frequency updates. I also think it looks a bit better, so double win. Before: https://github.com/user-attachments/assets/fee4ca82-700b-4c23-8f6b-71699b752431 After: https://github.com/user-attachments/assets/fab5014a-815b-49ac-adf0-e32ada5c1d32
1 parent 1b5f1ef commit d01f413

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

static/app/views/nav/secondary/secondarySidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ export function SecondarySidebar() {
6464
[NAV_SECONDARY_SIDEBAR_DATA_ATTRIBUTE]: true,
6565
}}
6666
>
67-
<AnimatePresence mode="wait" initial={false}>
67+
<AnimatePresence mode="popLayout" initial={false}>
6868
<MotionDiv
6969
key={activeNavGroup}
70-
initial={{x: -4, opacity: 0}}
70+
initial={{x: -6, opacity: 0}}
7171
animate={{x: 0, opacity: 1}}
72-
exit={{x: 4, opacity: 0}}
72+
exit={{x: 6, opacity: 0}}
7373
transition={{duration: 0.06}}
7474
>
7575
<SecondarySidebarInner>

0 commit comments

Comments
 (0)