Skip to content

Commit 8b8732e

Browse files
[material-ui][Menu,Popover] Fix Backdrop props descriptions (#43503)
Co-authored-by: ZeeshanTamboli <zeeshan.tamboli@gmail.com>
1 parent c1e89d9 commit 8b8732e

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

docs/pages/material-ui/api/popover.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
},
2121
"default": "'anchorEl'"
2222
},
23+
"BackdropComponent": {
24+
"type": { "name": "elementType" },
25+
"default": "styled(Backdrop, {\n name: 'MuiModal',\n slot: 'Backdrop',\n overridesResolver: (props, styles) => {\n return styles.backdrop;\n },\n})({\n zIndex: -1,\n})",
26+
"deprecated": true,
27+
"deprecationInfo": "Use <code>slotProps.root.slots.backdrop</code> instead. While this prop currently works, it will be removed in the next major version."
28+
},
29+
"BackdropProps": {
30+
"type": { "name": "object" },
31+
"deprecated": true,
32+
"deprecationInfo": "Use <code>slotProps.root.slotProps.backdrop</code> instead."
33+
},
2334
"children": { "type": { "name": "node" } },
2435
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
2536
"container": { "type": { "name": "union", "description": "HTML element<br>&#124;&nbsp;func" } },

docs/translations/api-docs/popover/popover.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"anchorReference": {
1717
"description": "This determines which anchor prop to refer to when setting the position of the popover."
1818
},
19+
"BackdropComponent": {
20+
"description": "A backdrop component. This prop enables custom backdrop rendering."
21+
},
22+
"BackdropProps": {
23+
"description": "Props applied to the <a href=\"/material-ui/api/backdrop/\"><code>Backdrop</code></a> element."
24+
},
1925
"children": { "description": "The content of the component." },
2026
"classes": { "description": "Override or extend the styles applied to the component." },
2127
"container": {

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { SxProps } from '@mui/system';
3-
import { InternalStandardProps as StandardProps } from '..';
3+
import { BackdropProps, InternalStandardProps as StandardProps } from '..';
44
import Paper, { PaperProps } from '../Paper';
55
import Modal, { ModalOwnerState, ModalProps } from '../Modal';
66
import { Theme } from '../styles';
@@ -39,7 +39,10 @@ interface PopoverVirtualElement {
3939
}
4040

4141
export interface PopoverProps
42-
extends StandardProps<Omit<ModalProps, 'slots' | 'slotProps'>, 'children'>,
42+
extends StandardProps<
43+
Omit<ModalProps, 'slots' | 'slotProps' | 'BackdropProps' | 'BackdropComponent'>,
44+
'children'
45+
>,
4346
PopoverSlotsAndSlotProps {
4447
/**
4548
* A ref for imperative actions.
@@ -82,6 +85,26 @@ export interface PopoverProps
8285
* @default 'anchorEl'
8386
*/
8487
anchorReference?: PopoverReference;
88+
/**
89+
* A backdrop component. This prop enables custom backdrop rendering.
90+
* @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
91+
* Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
92+
* @default styled(Backdrop, {
93+
* name: 'MuiModal',
94+
* slot: 'Backdrop',
95+
* overridesResolver: (props, styles) => {
96+
* return styles.backdrop;
97+
* },
98+
* })({
99+
* zIndex: -1,
100+
* })
101+
*/
102+
BackdropComponent?: React.ElementType<BackdropProps>;
103+
/**
104+
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
105+
* @deprecated Use `slotProps.root.slotProps.backdrop` instead.
106+
*/
107+
BackdropProps?: Partial<BackdropProps>;
85108
/**
86109
* The content of the component.
87110
*/

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,26 @@ Popover.propTypes /* remove-proptypes */ = {
518518
* @default 'anchorEl'
519519
*/
520520
anchorReference: PropTypes.oneOf(['anchorEl', 'anchorPosition', 'none']),
521+
/**
522+
* A backdrop component. This prop enables custom backdrop rendering.
523+
* @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
524+
* Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
525+
* @default styled(Backdrop, {
526+
* name: 'MuiModal',
527+
* slot: 'Backdrop',
528+
* overridesResolver: (props, styles) => {
529+
* return styles.backdrop;
530+
* },
531+
* })({
532+
* zIndex: -1,
533+
* })
534+
*/
535+
BackdropComponent: PropTypes.elementType,
536+
/**
537+
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
538+
* @deprecated Use `slotProps.root.slotProps.backdrop` instead.
539+
*/
540+
BackdropProps: PropTypes.object,
521541
/**
522542
* The content of the component.
523543
*/

0 commit comments

Comments
 (0)