Skip to content

Commit

Permalink
[Drawer] Fix PaperProps className merge conflict (#18740)
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp authored and oliviertassinari committed Dec 9, 2019
1 parent bdde1b5 commit 6b992f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
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

0 comments on commit 6b992f8

Please sign in to comment.