File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
4848 const [ _ , setRecalculateDimensionsCount ] = React . useState ( 0 ) ;
4949 const [ dialogMeasure ] = useMeasureForRef ( dialogRef ) ;
5050 const [ anchorMeasure , recalculateAnchorMeasure ] = useMeasureForRef ( anchor ) ;
51- const position = dialogPosition ( dialogMeasure , anchorMeasure , verticalOffset ) ;
51+ const position = anchor ? dialogPosition ( dialogMeasure , anchorMeasure , verticalOffset ) : undefined ;
5252
5353 React . useEffect ( ( ) => {
5454 const onClick = ( event : MouseEvent ) => {
@@ -106,10 +106,10 @@ export const Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({
106106 return (
107107 < dialog ref = { dialogRef } style = { {
108108 position : 'fixed' ,
109- margin : 0 ,
109+ margin : position ? 0 : undefined ,
110110 zIndex : 110 , // on top of split view resizer
111- top : position . top ,
112- left : position . left ,
111+ top : position ? .top ,
112+ left : position ? .left ,
113113 minWidth : minWidth || 0 ,
114114 ...externalStyle ,
115115 } } className = { className } data-testid = { dataTestId } >
You can’t perform that action at this time.
0 commit comments