diff --git a/src/components/modal/Modal.js b/src/components/modal/Modal.js index f81a3717..9bebba89 100644 --- a/src/components/modal/Modal.js +++ b/src/components/modal/Modal.js @@ -17,8 +17,9 @@ function Modal({ style, dialog_style, content_style, + backdrop_style, class_name, - modal_class_name, + dialog_class_name, content_class_name, backdrop_class_name, autofocus, @@ -31,10 +32,11 @@ function Modal({ zIndex, dialogStyle, contentStyle, + backdropStyle, className, backdropClassName, contentClassName, - modalClassName, + dialogClassName, setProps, ...otherProps }) { @@ -48,11 +50,12 @@ function Modal({ { 'custom-modal-backdrop' ); + // Backdrop style + rerender(); + expect(document.body.querySelector('.modal-backdrop')).toHaveStyle({ + color: 'red' + }); + // Dialog class name - rerender(); + rerender(); expect(document.body.querySelector('.modal-dialog')).toHaveClass( 'custom-modal-dialog' ); @@ -106,10 +112,14 @@ describe('Modal', () => { }); // Modal class name - rerender(); + rerender(); expect(document.body.querySelector('.modal')).toHaveClass( 'custom-modal-class' ); + + // Modal style + rerender(); + expect(document.body.querySelector('.modal')).toHaveStyle({color: 'red'}); }); test('sets z-index with zindex and zIndex', () => { diff --git a/src/components/popover/Popover.js b/src/components/popover/Popover.js index 16062324..5aef79a4 100644 --- a/src/components/popover/Popover.js +++ b/src/components/popover/Popover.js @@ -193,11 +193,6 @@ Popover.propTypes = { */ class_name: PropTypes.string, - /** - * CSS class to apply to the Popover. - */ - inner_class_name: PropTypes.string, - /** * Used to allow user interactions to be persisted when the page is refreshed. * See https://dash.plotly.com/persistence for more details @@ -238,13 +233,6 @@ Popover.propTypes = { */ className: PropTypes.string, - /** - * **DEPRECATED** Use `inner_class_name` instead. - * - * CSS class to apply to the Popover. - */ - innerClassName: PropTypes.string, - /** * Dash-assigned callback that gets fired when the value changes. */ diff --git a/src/private/Modal.js b/src/private/Modal.js index ce434b76..e853e0e7 100644 --- a/src/private/Modal.js +++ b/src/private/Modal.js @@ -39,6 +39,7 @@ const Modal = React.forwardRef(function Modal( children, dialogStyle, contentStyle, + backdropStyle, 'data-bs-theme': dataBsTheme, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, @@ -219,7 +220,7 @@ const Modal = React.forwardRef(function Modal( backdropClassName, !animation && 'show' )} - style={{zIndex}} + style={{...backdropStyle, zIndex}} /> ), [animation, backdropClassName, zIndex] @@ -253,8 +254,8 @@ const Modal = React.forwardRef(function Modal( {...props} onMouseDown={handleDialogMouseDown} className={dialogClassName} - contentClassName={contentClassName} style={dialogStyle} + contentClassName={contentClassName} contentStyle={contentStyle} > {children} @@ -299,6 +300,7 @@ Modal.propTypes = { style: PropTypes.object, dialogStyle: PropTypes.object, contentStyle: PropTypes.object, + backdropStyle: PropTypes.object, zIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), size: PropTypes.string, fullscreen: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),