Skip to content

Commit 83b1a24

Browse files
committed
[Popover] Adding MocalClasses prop to popover component
1 parent 8ff24dc commit 83b1a24

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

packages/material-ui/src/Popover/Popover.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface PopoverProps
2828
getContentAnchorEl?: (element: HTMLElement) => HTMLElement;
2929
marginThreshold?: number;
3030
modal?: boolean;
31-
ModalProps?: Partial<ModalProps>;
31+
ModalClasses?: ModalClassKey;
3232
PaperProps?: Partial<PaperProps>;
3333
role?: string;
3434
transformOrigin?: PopoverOrigin;

packages/material-ui/src/Popover/Popover.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class Popover extends React.Component {
278278
elevation,
279279
getContentAnchorEl,
280280
marginThreshold,
281-
ModalProps,
281+
ModalClasses,
282282
onEnter,
283283
onEntered,
284284
onEntering,
@@ -295,11 +295,6 @@ class Popover extends React.Component {
295295
...other
296296
} = this.props;
297297

298-
const allModalProps = {
299-
...other,
300-
...ModalProps,
301-
};
302-
303298
let transitionDuration = transitionDurationProp;
304299

305300
if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
@@ -314,10 +309,11 @@ class Popover extends React.Component {
314309

315310
return (
316311
<Modal
312+
classes={ModalClasses}
317313
container={container}
318314
open={open}
319315
BackdropProps={{ invisible: true }}
320-
{...allModalProps}
316+
{...other}
321317
>
322318
<TransitionComponent
323319
appear
@@ -431,9 +427,9 @@ Popover.propTypes = {
431427
*/
432428
marginThreshold: PropTypes.number,
433429
/**
434-
* Properties applied to the [`Modal`](/api/modal) element.
430+
* `classes` property applied to the [`Modal`](/api/modal) element.
435431
*/
436-
ModalProps: PropTypes.object,
432+
ModalClasses: PropTypes.object,
437433
/**
438434
* Callback fired when the component requests to be closed.
439435
*

pages/api/popover.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ title: Popover API
2626
| <span class="prop-name">elevation</span> | <span class="prop-type">number | <span class="prop-default">8</span> | The elevation of the popover. |
2727
| <span class="prop-name">getContentAnchorEl</span> | <span class="prop-type">func |   | This function is called in order to retrieve the content anchor element. It's the opposite of the `anchorEl` property. The content anchor element should be an element inside the popover. It's used to correctly scroll and set the position of the popover. The positioning strategy tries to make the content anchor element just above the anchor element. |
2828
| <span class="prop-name">marginThreshold</span> | <span class="prop-type">number | <span class="prop-default">16</span> | Specifies how close to the edge of the window the popover can appear. |
29-
| <span class="prop-name">ModalProps</span> | <span class="prop-type">object |   | Properties applied to the [`Modal`](/api/modal) element. |
29+
| <span class="prop-name">ModalClasses</span> | <span class="prop-type">object |   | Override or extend the styles applied to the Modal component. See [CSS API](#css-api) below for more details. |
3030
| <span class="prop-name">onClose</span> | <span class="prop-type">func |   | 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. |
3131
| <span class="prop-name">onEnter</span> | <span class="prop-type">func |   | Callback fired before the component is entering. |
3232
| <span class="prop-name">onEntered</span> | <span class="prop-type">func |   | Callback fired when the component has entered. |

0 commit comments

Comments
 (0)