From aed189556a44bd1f0d88fe5c26a02640907fc32d Mon Sep 17 00:00:00 2001 From: Chris Malley Date: Tue, 22 Jan 2019 14:34:31 -0700 Subject: [PATCH] use trail.containsNode in ComboBox, phetsims/scenery#927 --- js/ComboBox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ComboBox.js b/js/ComboBox.js index aa298706..610a2beb 100644 --- a/js/ComboBox.js +++ b/js/ComboBox.js @@ -171,9 +171,9 @@ define( require => { // @private listener for 'click outside to dismiss' this.clickToDismissListener = { down: event => { - //TODO scenery#927 is trail.nodes public? should we add Trail.containsNode? + // Ignore if we click over the button, since the button will handle hiding the list. - if ( event.trail.nodes.indexOf( this.button ) === -1 ) { + if ( !event.trail.containsNode( this.button ) ) { this.hideListBox(); } }