File tree 3 files changed +29
-8
lines changed
3 files changed +29
-8
lines changed Original file line number Diff line number Diff line change @@ -223,11 +223,15 @@ class Dialog extends Popup {
223
223
}
224
224
225
225
onEnterDOM ( ) {
226
+ super . onEnterDOM ( ) ;
227
+
226
228
ResizeHandler . register ( this , this . _screenResizeHandler ) ;
227
229
ResizeHandler . register ( document . body , this . _screenResizeHandler ) ;
228
230
}
229
231
230
232
onExitDOM ( ) {
233
+ super . onExitDOM ( ) ;
234
+
231
235
ResizeHandler . deregister ( this , this . _screenResizeHandler ) ;
232
236
ResizeHandler . deregister ( document . body , this . _screenResizeHandler ) ;
233
237
}
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ const metadata = {
56
56
} ,
57
57
58
58
/**
59
- * Indicates if the elements is open
59
+ * Indicates if the element is open
60
60
* @private
61
61
* @type {boolean }
62
62
* @defaultvalue false
@@ -207,6 +207,19 @@ class Popup extends UI5Element {
207
207
return staticAreaStyles ;
208
208
}
209
209
210
+ onEnterDOM ( ) {
211
+ if ( ! this . isOpen ( ) ) {
212
+ this . _blockLayerHidden = true ;
213
+ }
214
+ }
215
+
216
+ onExitDOM ( ) {
217
+ if ( this . isOpen ( ) ) {
218
+ Popup . unblockBodyScrolling ( ) ;
219
+ this . _removeOpenedPopup ( ) ;
220
+ }
221
+ }
222
+
210
223
get _displayProp ( ) {
211
224
return "block" ;
212
225
}
@@ -432,13 +445,6 @@ class Popup extends UI5Element {
432
445
this . style . display = "none" ;
433
446
}
434
447
435
- onExitDOM ( ) {
436
- if ( this . isOpen ( ) ) {
437
- Popup . unblockBodyScrolling ( ) ;
438
- this . _removeOpenedPopup ( ) ;
439
- }
440
- }
441
-
442
448
/**
443
449
* Implement this getter with relevant logic regarding the modality of the popup (e.g. based on a public property)
444
450
*
Original file line number Diff line number Diff line change @@ -127,6 +127,17 @@ describe("Dialog general interaction", () => {
127
127
128
128
closeButton . click ( ) ;
129
129
} ) ;
130
+
131
+ it ( "test dialog overlay when dialog isn't open" , ( ) => {
132
+ const isBlockLayerHidden = browser . executeAsync ( async ( done ) => {
133
+ const dialog = document . getElementById ( "dialog" ) ;
134
+ const staticAreaItemDomRef = await dialog . getStaticAreaItemDomRef ( ) ;
135
+
136
+ done ( staticAreaItemDomRef . querySelector ( ".ui5-block-layer" ) . hasAttribute ( "hidden" ) ) ;
137
+ } ) ;
138
+
139
+ assert . ok ( isBlockLayerHidden , "the block layer is hidden" ) ;
140
+ } ) ;
130
141
} ) ;
131
142
132
143
You can’t perform that action at this time.
0 commit comments