@@ -271,6 +271,22 @@ class Dialog extends Popup {
271
271
return this . resizable && this . onDesktop ;
272
272
}
273
273
274
+ get _minHeight ( ) {
275
+ let minHeight = Number . parseInt ( window . getComputedStyle ( this . contentDOM ) . minHeight ) ;
276
+
277
+ const header = this . _root . querySelector ( ".ui5-popup-header-root" ) ;
278
+ if ( header ) {
279
+ minHeight += header . offsetHeight ;
280
+ }
281
+
282
+ const footer = this . _root . querySelector ( ".ui5-popup-footer-root" ) ;
283
+ if ( footer ) {
284
+ minHeight += footer . offsetHeight ;
285
+ }
286
+
287
+ return minHeight ;
288
+ }
289
+
274
290
_show ( ) {
275
291
super . _show ( ) ;
276
292
this . _center ( ) ;
@@ -465,7 +481,6 @@ class Dialog extends Popup {
465
481
const { top, left } = this . getBoundingClientRect ( ) ,
466
482
style = window . getComputedStyle ( this ) ,
467
483
minWidth = Number . parseFloat ( style . minWidth ) ,
468
- minHeight = Number . parseFloat ( style . minHeight ) ,
469
484
maxWidth = window . innerWidth - left ,
470
485
maxHeight = window . innerHeight - top ;
471
486
@@ -488,7 +503,7 @@ class Dialog extends Popup {
488
503
}
489
504
490
505
width = clamp ( width , minWidth , maxWidth ) ;
491
- height = clamp ( height , minHeight , maxHeight ) ;
506
+ height = clamp ( height , this . _minHeight , maxHeight ) ;
492
507
493
508
Object . assign ( this . style , {
494
509
width : `${ width } px` ,
@@ -523,7 +538,6 @@ class Dialog extends Popup {
523
538
width,
524
539
height,
525
540
minWidth,
526
- minHeight,
527
541
} = window . getComputedStyle ( this ) ;
528
542
529
543
this . _initialX = event . clientX ;
@@ -533,7 +547,7 @@ class Dialog extends Popup {
533
547
this . _initialTop = top ;
534
548
this . _initialLeft = left ;
535
549
this . _minWidth = Number . parseFloat ( minWidth ) ;
536
- this . _minHeight = Number . parseFloat ( minHeight ) ;
550
+ this . _cachedMinHeight = this . _minHeight ;
537
551
538
552
Object . assign ( this . style , {
539
553
top : `${ top } px` ,
@@ -571,7 +585,7 @@ class Dialog extends Popup {
571
585
572
586
const newHeight = clamp (
573
587
this . _initialHeight + ( clientY - this . _initialY ) ,
574
- this . _minHeight ,
588
+ this . _cachedMinHeight ,
575
589
window . innerHeight - this . _initialTop ,
576
590
) ;
577
591
@@ -583,14 +597,14 @@ class Dialog extends Popup {
583
597
}
584
598
585
599
_onResizeMouseUp ( ) {
586
- this . _initialX = null ;
587
- this . _initialY = null ;
588
- this . _initialWidth = null ;
589
- this . _initialHeight = null ;
590
- this . _initialTop = null ;
591
- this . _initialLeft = null ;
592
- this . _minWidth = null ;
593
- this . _minHeight = null ;
600
+ delete this . _initialX ;
601
+ delete this . _initialY ;
602
+ delete this . _initialWidth ;
603
+ delete this . _initialHeight ;
604
+ delete this . _initialTop ;
605
+ delete this . _initialLeft ;
606
+ delete this . _minWidth ;
607
+ delete this . _cachedMinHeight ;
594
608
595
609
this . _detachMouseResizeHandlers ( ) ;
596
610
}
0 commit comments