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

[BUG] <Reorder.Group /> stops working if axis is changing after window resize #3022

Open
Profesor08 opened this issue Jan 23, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Profesor08
Copy link

Profesor08 commented Jan 23, 2025

If the axis changes on window resize (detected by matchMedia), <Reorder.Group /> stops reordering and allows only dragging, but the state is not changing.
However, if I change the axis by clicking on a button, and the window size is not changed, it works well.

Reproduction of the bug

https://stackblitz.com/edit/vitejs-vite-7pbqpyha?file=src%2FApp.tsx

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/vitejs-vite-7pbqpyha?file=src%2FApp.tsx
  2. Resize preview
  3. Drag items

Expected behavior

To work correctly if axis is changed

Video or screenshots

20250123-1403-34.5976746.mp4
@Profesor08 Profesor08 added the bug Something isn't working label Jan 23, 2025
@Profesor08
Copy link
Author

Profesor08 commented Jan 23, 2025

For those who run in same issue, there are workarounds

  • add a key prop for <Reorder.Group key={axis.toString()} />, this will force component recreation, with all side effects...
  • use setTimeout after window size changes

Any way this workarounds are just workarounds , and not are solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant