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

[Drawer] Fix PaperProps className merge conflict #18740

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/api/drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ when `variant="temporary"` is set.
| <span class="prop-name">ModalProps</span> | <span class="prop-type">object</span> | <span class="prop-default">{}</span> | Props applied to the [`Modal`](/api/modal/) element. |
| <span class="prop-name">onClose</span> | <span class="prop-type">func</span> | | Callback fired when the component requests to be closed.<br><br>**Signature:**<br>`function(event: object) => void`<br>*event:* The event source of the callback. |
| <span class="prop-name">open</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the drawer is open. |
| <span class="prop-name">PaperProps</span> | <span class="prop-type">object</span> | | Props applied to the [`Paper`](/api/paper/) element. |
| <span class="prop-name">PaperProps</span> | <span class="prop-type">object</span> | <span class="prop-default">{}</span> | Props applied to the [`Paper`](/api/paper/) element. |
| <span class="prop-name">SlideProps</span> | <span class="prop-type">object</span> | | Props applied to the [`Slide`](/api/slide/) element. |
| <span class="prop-name">transitionDuration</span> | <span class="prop-type">number<br>&#124;&nbsp;{ enter?: number, exit?: number }</span> | <span class="prop-default">{ enter: duration.enteringScreen, exit: duration.leavingScreen }</span> | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object. |
| <span class="prop-name">variant</span> | <span class="prop-type">'permanent'<br>&#124;&nbsp;'persistent'<br>&#124;&nbsp;'temporary'</span> | <span class="prop-default">'temporary'</span> | The variant to use. |
Expand Down
13 changes: 9 additions & 4 deletions packages/material-ui/src/Drawer/Drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const Drawer = React.forwardRef(function Drawer(props, ref) {
ModalProps: { BackdropProps: BackdropPropsProp, ...ModalProps } = {},
onClose,
open = false,
PaperProps,
PaperProps = {},
SlideProps,
transitionDuration = defaultTransitionDuration,
variant = 'temporary',
Expand All @@ -134,9 +134,14 @@ const Drawer = React.forwardRef(function Drawer(props, ref) {
<Paper
elevation={variant === 'temporary' ? elevation : 0}
square
className={clsx(classes.paper, classes[`paperAnchor${capitalize(anchor)}`], {
[classes[`paperAnchorDocked${capitalize(anchor)}`]]: variant !== 'temporary',
})}
className={clsx(
classes.paper,
classes[`paperAnchor${capitalize(anchor)}`],
{
[classes[`paperAnchorDocked${capitalize(anchor)}`]]: variant !== 'temporary',
},
PaperProps.className,
)}
{...PaperProps}
>
{children}
Expand Down