Skip to content

Commit

Permalink
hideList should be a noop if the list is not visible, #445
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jan 20, 2019
1 parent 4c63c3c commit 46078f6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions js/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ define( require => {
* @public
*/
showList() {

if ( !this.listBox.visible ) {
this.phetioStartEvent( 'popupShown' );

Expand All @@ -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();
}
},

/**
Expand Down

0 comments on commit 46078f6

Please sign in to comment.