-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[SwipeableDrawer] Discovery and hysteresis broken in React v18 #30414
Comments
I don't understand what is the problem. Can you expend a bit on describing the problem? |
Sure.
Run my sample (or any react 18 sample) in eg. chromium and switch to responsive/mobile in the dev tools. Then click and hold within 20px of the left border of the app to reproduce. |
I can reproduce it. It seems like a bug indeed. |
Seeing this issue as well. Any update on this? |
We haven't done any work on it so far. We're happy to accept contributions from the community. |
I can confirm this is happening still. My best guess at what I believe what's happening is that when rendering the drawer / paper component, it deletes/replaces the existing styles, instead of just overriding the ones that have changed. I've been working on my PR's unit tests, trying to figure out why they are broken for a long time now, and I now believe this to be the reason. |
There is a change in the behavior between React 17 and React 18 in terms of when the paper ref is being set, which makes this line https://github.com/mui/material-ui/blob/master/packages/mui-material/src/SwipeableDrawer/SwipeableDrawer.js#L492 not being invoked in React 18, while it is invoked in React 17. React 18 codesandbox: https://codesandbox.io/s/unruffled-poincare-2v4pk I will try to create a simpler repro to see what may be the issue, as there are quite a lot of moving parts here: Drawer, Modal, Slider etc. |
I've created #34505 which is fixing the two issues mentioned here. I am not 100% happy with the fix, as it requires using Here is a sandbox with the fix: https://codesandbox.io/s/7qkr9k?file=/demo.tsx |
Duplicates
Latest version
Current behavior 😯
Expected behavior 🤔
No response
Steps to reproduce 🕹
https://codesandbox.io/s/unruffled-poincare-2v4pk
Context 🔦
No response
Your environment 🌎
The text was updated successfully, but these errors were encountered: