[material-ui][Modal] Bring back transition component in test that fails with React 19 #43312
Labels
component: modal
This is the name of the generic UI component, not the React module!
package: material-ui
Specific to @mui/material
test
While upgrading to React 19 (PR), a
Modal
component test started to fail (failure example). TheModal
is not unmounted. The component works as expected when tested manually, but the combination ofModal
+Fade
(and probably any other transition component) makes the test fail.material-ui/packages/mui-material/src/Modal/Modal.test.js
Lines 590 to 612 in d00b50e
The issue linked in the comment above the test points to a PR where a fix was implemented for a bug with the backdrop staying open. The fix consisted on:
This fix was lost in translation once
Modal
was migrated to useuseModal
from Base UI. Last year, a user reported the bug again.Re-applying this fix solves the failing test, but breaks one
Drawer
component (which usesModal
under the hood) use case: when theDrawer
is initially open, it won't run the exit animation the first time is closed.Note: Using
true
as the initial state is the approach used across the codebase, withModal
being the only component using!open
as the initial state.We decided to remove the
Fade
component as child in the test to make it pass (see #42824), but we want to investigate further and bring it back.Search keywords: modal, react 19, transition, test
The text was updated successfully, but these errors were encountered: