[SwipeableDrawer] Discovery and hysteresis broken in React v18
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
- Discovery opens drawer completely
- Partially opened drawer (> hysteresis) is not opened completely
Expected behavior 🤔
No response
Steps to reproduce 🕹
https://codesandbox.io/s/unruffled-poincare-2v4pk
Context 🔦
No response
Your environment 🌎
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@mui/material": "^5.2.5",
"react": "18.0.0-rc.0",
"react-dom": "18.0.0-rc.0"
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:8 (6 by maintainers)
Top Results From Across the Web
React v18.0 – React Blog
In this post, we'll give an overview of what's new in React 18, and what it means for the future. Our latest major...
Read more >Concurrent UI Patterns (Experimental) - React
When we click “Next”, nothing happens and it feels like the app is broken. Our useTransition() call returns two values: startTransition and isPending...
Read more >Suspense for Data Fetching (Experimental) - React
For details about concurrent APIs in React 18, refer to: ... The rest of this page includes content that's stale, broken, or incorrect....
Read more >React MUI SwipeableDrawer API - GeeksforGeeks
In this article, we will discuss the React MUI SwipeableDrawer API. ... in the drawer for the accidental discovery of the swipe gesture....
Read more >Reproducibility of edge probing tasks - Nyu-Mll/Jiant - IssueHint
[SwipeableDrawer] Discovery and hysteresis broken in React v18, 5, 2021-12-27, 2022-07-25. Revert "New JSX transform" + version bump, 0, 2021-01-26 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve created https://github.com/mui/material-ui/pull/34505 which is fixing the two issues mentioned here. I am not 100% happy with the fix, as it requires using
keepMounted
on the Modal, but let’s see if other maintainers will have some suggestions around this.Here is a sandbox with the fix: https://codesandbox.io/s/7qkr9k?file=/demo.tsx
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. This means that the
transform
style is deleted, and as such, the discovery doesn’t work. Although, that’s only a guess based on logging output of styles that I’ve been debugging.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.