From 46078f6e851408eb696fcc8719cd14a30b75bb96 Mon Sep 17 00:00:00 2001 From: Chris Malley Date: Sat, 19 Jan 2019 17:04:58 -0700 Subject: [PATCH] hideList should be a noop if the list is not visible, #445 --- js/ComboBox.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/js/ComboBox.js b/js/ComboBox.js index 5b9aff3c..2e040a48 100644 --- a/js/ComboBox.js +++ b/js/ComboBox.js @@ -230,7 +230,6 @@ define( require => { * @public */ showList() { - if ( !this.listBox.visible ) { this.phetioStartEvent( 'popupShown' ); @@ -251,16 +250,18 @@ define( require => { * @public */ hideList() { - this.phetioStartEvent( 'popupHidden' ); + if ( this.listBox.visible ) { + this.phetioStartEvent( 'popupHidden' ); - if ( this.display && this.display.hasInputListener( this.clickToDismissListener ) ) { - this.display.removeInputListener( this.clickToDismissListener ); - this.display = null; - } + if ( this.display && this.display.hasInputListener( this.clickToDismissListener ) ) { + this.display.removeInputListener( this.clickToDismissListener ); + this.display = null; + } - this.listBox.visible = false; + this.listBox.visible = false; - this.phetioEndEvent(); + this.phetioEndEvent(); + } }, /**