diff --git a/web/pgadmin/static/js/helpers/ModalProvider.jsx b/web/pgadmin/static/js/helpers/ModalProvider.jsx index 05f0dc074..0474f2fee 100644 --- a/web/pgadmin/static/js/helpers/ModalProvider.jsx +++ b/web/pgadmin/static/js/helpers/ModalProvider.jsx @@ -24,6 +24,8 @@ import { Rnd } from 'react-rnd'; import { ExpandDialogIcon, MinimizeDialogIcon } from '../components/ExternalIcon'; const ModalContext = React.createContext({}); +const MIN_HEIGHT = 190; +const MIN_WIDTH = 500; export function useModal() { return React.useContext(ModalContext); @@ -167,19 +169,22 @@ function PaperComponent(props) { return props.isfullscreen == 'true' ? { x: 0, y: 0 } : dialogPosition && { x: dialogPosition.x, y: dialogPosition.y }; }; + const y_position = props.height ? (window.innerHeight/2) - (props.height/2) : (window.innerHeight/2) - (MIN_HEIGHT/2); + const x_position = props.width ? (window.innerWidth/2) - (props.width/2) : (window.innerWidth/2) - (MIN_WIDTH/2); + return ( props.isresizeable == 'true' ?