Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Enhancement] Added modalStyle prop Portaled to override default values (#83)

Giuseppe Macrìf356fe43f50d
diff --git a/src/components/common/portaled.js b/src/components/common/portaled.js
index 1d0b49ad5..1b73becb2 100644
--- a/src/components/common/portaled.js
+++ b/src/components/common/portaled.js
@@ -186,17 +186,22 @@ class Portaled extends Component {
isOpened,
onClose,
- // Mordal
+ // Modal
children,
- modalProps
+ modalProps,
+ modalStyle = {}
} = this.props;
const {isVisible, pos} = this.state;
- const modalStyle = {
+ const newModalStyle = {
...defaultModalStyle,
+ content: {
+ ...(modalStyle.content || {})
+ },
overlay: {
...defaultModalStyle.overlay,
+ ...(modalStyle.overlay || {}),
// needs to be on top of existing modal
zIndex: overlayZIndex || 9999
}
@@ -212,7 +217,7 @@ class Portaled extends Component {
{...modalProps}
ariaHideApp={false}
isOpen
- style={modalStyle}
+ style={newModalStyle}
parentSelector={() => {
// React modal issue: https://github.com/reactjs/react-modal/issues/769
// failed to execute removeChild on parent node when it is already unmounted