66import { isIOS } from '@vaadin/component-base/src/browser-utils.js' ;
77import { OverlayFocusMixin } from './vaadin-overlay-focus-mixin.js' ;
88import { OverlayStackMixin } from './vaadin-overlay-stack-mixin.js' ;
9+ import { setOverlayStateAttribute } from './vaadin-overlay-utils.js' ;
910
1011/**
1112 * @polymerMixin
@@ -91,6 +92,7 @@ export const OverlayMixin = (superClass) =>
9192 type : Boolean ,
9293 value : false ,
9394 reflectToAttribute : true ,
95+ observer : '_withBackdropChanged' ,
9496 sync : true ,
9597 } ,
9698 } ;
@@ -279,6 +281,12 @@ export const OverlayMixin = (superClass) =>
279281 this . _removeGlobalListeners ( ) ;
280282 this . _exitModalState ( ) ;
281283 }
284+ setOverlayStateAttribute ( this , 'modeless' , modeless ) ;
285+ }
286+
287+ /** @private */
288+ _withBackdropChanged ( withBackdrop ) {
289+ setOverlayStateAttribute ( this , 'with-backdrop' , withBackdrop ) ;
282290 }
283291
284292 /** @private */
@@ -378,7 +386,7 @@ export const OverlayMixin = (superClass) =>
378386 if ( ! this . modeless ) {
379387 this . _enterModalState ( ) ;
380388 }
381- this . setAttribute ( 'opening' , '' ) ;
389+ setOverlayStateAttribute ( this , 'opening' , true ) ;
382390
383391 if ( this . _shouldAnimate ( ) ) {
384392 this . _enqueueAnimation ( 'opening' , ( ) => {
@@ -398,15 +406,15 @@ export const OverlayMixin = (superClass) =>
398406
399407 /** @private */
400408 _finishOpening ( ) {
401- this . removeAttribute ( 'opening' ) ;
409+ setOverlayStateAttribute ( this , 'opening' , false ) ;
402410 }
403411
404412 /** @private */
405413 _finishClosing ( ) {
406414 this . _detachOverlay ( ) ;
407415 this . _removeAttachedInstance ( ) ;
408416 this . $ . overlay . style . removeProperty ( 'pointer-events' ) ;
409- this . removeAttribute ( 'closing' ) ;
417+ setOverlayStateAttribute ( this , 'closing' , false ) ;
410418 this . dispatchEvent ( new CustomEvent ( 'vaadin-overlay-closed' ) ) ;
411419 }
412420
@@ -417,7 +425,7 @@ export const OverlayMixin = (superClass) =>
417425 }
418426 if ( this . _isAttached ) {
419427 this . _exitModalState ( ) ;
420- this . setAttribute ( 'closing' , '' ) ;
428+ setOverlayStateAttribute ( this , 'closing' , true ) ;
421429 this . dispatchEvent ( new CustomEvent ( 'vaadin-overlay-closing' ) ) ;
422430
423431 if ( this . _shouldAnimate ( ) ) {
0 commit comments