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

Merged
merged 9 commits into from
Jan 16, 2025

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
@yash49 yash49 force-pushed the depracate-drawer-classes branch from 1c30ac0 to 6ad037e Compare January 12, 2025 20:08
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 12, 2025
@yash49
Copy link
Contributor Author

yash49 commented Jan 12, 2025

@yash49
Copy link
Contributor Author

yash49 commented Jan 12, 2025

@DiegoAndai I've also added the test
please review the PR

@yash49 yash49 requested a review from DiegoAndai January 12, 2025 20:55
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.

I think this is the last thing to fix:

packages/mui-material/src/Drawer/drawerClasses.ts Outdated Show resolved Hide resolved
packages/mui-material/src/Drawer/drawerClasses.ts Outdated Show resolved Hide resolved
yash49 and others added 2 commits January 17, 2025 00:34
@yash49
Copy link
Contributor Author

yash49 commented Jan 16, 2025

I think this is the last thing to fix:

Good catch
Thanks
I've updated the PR

@yash49 yash49 requested a review from DiegoAndai January 16, 2025 19:06
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 @yash49!

@DiegoAndai DiegoAndai merged commit 820a76c into mui:master Jan 16, 2025
22 checks passed
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!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants