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

[material-ui][Drawer] Deprecate composed classes #44870

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yash49
Copy link
Contributor

@yash49 yash49 commented Dec 27, 2024

@mui-bot
Copy link

mui-bot commented Dec 27, 2024

@yash49 yash49 force-pushed the depracate-drawer-classes branch from 085151b to 846dfdc Compare December 27, 2024 21:51
@yash49 yash49 marked this pull request as ready for review December 27, 2024 22:01
@yash49
Copy link
Contributor Author

yash49 commented Dec 27, 2024

I observed that SwipeableDrawer uses .MuiDrawer-<...> classes
instead of .MuiSwipeableDrawer-<...> classes

but the docs mention that it uses .MuiSwipeableDrawer-<...> classes

Question to maintainers -

  1. SwipeableDrawer was affected by this PR
    Do I have to make any other changes for SwipeableDrawer

  2. Also is there a way to fix this ?
    image
    SwipeableDrawer class is deprecated but combined Drawer classes should be used instead?

@yash49
Copy link
Contributor Author

yash49 commented Dec 27, 2024

  1. Do we need any tests for new MuiDrawer-anchor<Direction> classes ?

@zannager zannager added the component: drawer This is the name of the generic UI component, not the React module! label Dec 30, 2024
@zannager zannager requested a review from DiegoAndai December 30, 2024 10:42
@yash49 yash49 force-pushed the depracate-drawer-classes branch from ccebcdd to f5f74da Compare January 7, 2025 20:31
Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @yash49, great work! Sorry for the delay.

About 1. and 2. about the classes, they were incorrectly documented. You're correct, the documentation should mention MuiDrawer, not MuiSwipeableDrawer. I pushed a commit to fix this.

  1. Do we need any tests for new MuiDrawer-anchor<Direction> classes?

Yes, please! 😊

May I also ask you to prepare a sandbox (You can use this one which uses this PR builds) testing that the deprecated classes are correctly replaced by the suggested compositions? For example:

In the sandbox, have two drawers, one with:

<Drawer
    sx={[`&.${drawerClasses.paperAnchorBottom}`]: {
        backgroundColor: 'red',
    }
/>

and another with:

<Drawer
    sx={[`&.${drawerClasses.anchorBottom} > .${drawerClasses.paper}`]: {
        backgroundColor: 'red',
    }
/>

And the result should be the same.

No need to do it with all the combinations, these should be enough:

  • paperAnchorBottom
  • paperAnchorDockedBottom

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: drawer This is the name of the generic UI component, not the React module! PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants