@@ -15,6 +15,7 @@ define( require => {
15
15
const AccessibilityUtil = require ( 'SCENERY/accessibility/AccessibilityUtil' ) ;
16
16
const AccessiblePeer = require ( 'SCENERY/accessibility/AccessiblePeer' ) ;
17
17
const AlignBox = require ( 'SCENERY/nodes/AlignBox' ) ;
18
+ const BooleanProperty = require ( 'AXON/BooleanProperty' ) ;
18
19
const DialogIO = require ( 'SUN/DialogIO' ) ;
19
20
const Display = require ( 'SCENERY/display/Display' ) ;
20
21
const FullScreen = require ( 'SCENERY/util/FullScreen' ) ;
@@ -147,8 +148,11 @@ define( require => {
147
148
// see https://github.com/phetsims/joist/issues/293
148
149
assert && assert ( this . isModal , 'Non-modal dialogs not currently supported' ) ;
149
150
150
- // @protected - whether the dialog is showing
151
- this . isShowing = false ;
151
+ // @protected (read-only) - whether the dialog is showing
152
+ this . isShowingProperty = new BooleanProperty ( false , {
153
+ tandem : options . tandem . createTandem ( 'isShowingProperty' ) ,
154
+ phetioReadOnly : true
155
+ } ) ;
152
156
153
157
// create close button
154
158
const closeButton = new CloseButton ( {
@@ -302,9 +306,9 @@ define( require => {
302
306
303
307
// @public
304
308
show : function ( ) {
305
- if ( ! this . isShowing ) {
309
+ if ( ! this . isShowingProperty . value ) {
306
310
window . phet . joist . sim . showPopup ( this , this . isModal ) ;
307
- this . isShowing = true ;
311
+ this . isShowingProperty . value = true ;
308
312
309
313
// a11y - focus is returned to this element if dialog closed from accessible input
310
314
this . activeElement = this . activeElement || Display . focusedNode ;
@@ -329,10 +333,10 @@ define( require => {
329
333
* @public
330
334
*/
331
335
hide : function ( ) {
332
- if ( this . isShowing ) {
336
+ if ( this . isShowingProperty . value ) {
333
337
334
338
window . phet . joist . sim . hidePopup ( this , this . isModal ) ;
335
- this . isShowing = false ;
339
+ this . isShowingProperty . value = false ;
336
340
337
341
// a11y - when the dialog is hidden, make all ScreenView content visible to assistive technology
338
342
this . sim . setAccessibleViewsVisible ( true ) ;
0 commit comments