You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only reproducible if NOT using strict mode and in development OR with a production build.
Click open: panel opens from the right ✅
Click close: panel closes from the left ✅
Click open: panel opens from the left 🔴
Actual behavior
The first time the panel opens from the right as it should. All subsequent times it opens from the left.
I believe this is because when the current stack of the component changes, the direction state is "pop" when it should be "push", until the useEffect sets it to "push" but it is too late to affect the transition component.
Expected behavior
The panel should always open from the right.
Possible solution
I already made a POC that seems to solve the issue. I make sure the direction is not a state but a value computed immediately in the render function based on the latest and the previous stack's length.
If this is confirmed to be a bug I'm happy to submit a PR.
The text was updated successfully, but these errors were encountered:
Environment
Code SandboxStackblitz(The code sandbox cannot be forked right now, it shows a warning about insufficient credits)
https://stackblitz.com/edit/vitejs-vite-sqvhmd?file=src%2FPanelStack.tsx
Steps to reproduce
Only reproducible if NOT using strict mode and in development OR with a production build.
Actual behavior
The first time the panel opens from the right as it should. All subsequent times it opens from the left.
I believe this is because when the current stack of the component changes, the
direction
state is "pop" when it should be "push", until theuseEffect
sets it to "push" but it is too late to affect the transition component.Expected behavior
The panel should always open from the right.
Possible solution
I already made a POC that seems to solve the issue. I make sure the direction is not a state but a value computed immediately in the render function based on the latest and the previous stack's length.
If this is confirmed to be a bug I'm happy to submit a PR.
The text was updated successfully, but these errors were encountered: