From 114fec88419ee95ef87345d3e44a826f0b45465b Mon Sep 17 00:00:00 2001 From: zepumph Date: Thu, 11 Mar 2021 11:03:21 -0900 Subject: [PATCH] respect inputEnabled up the trail, not just at the leaf-most node, https://github.com/phetsims/scenery/issues/1116 --- js/input/Input.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/input/Input.js b/js/input/Input.js index 913f39679..4ea464529 100644 --- a/js/input/Input.js +++ b/js/input/Input.js @@ -1913,12 +1913,16 @@ class Input { return; } + const inputEnabledIndex = trail.getLastInputEnabledIndex(); + for ( let i = trail.nodes.length - 1; i >= 0; bubbles ? i-- : i = -1 ) { const target = trail.nodes[ i ]; + const trailInputDisabled = inputEnabledIndex < i; + // TODO: what about handling input disabled nodes that are manually getting exit events called on them in branchChangeEvents, https://github.com/phetsims/scenery/issues/1116 - if ( target.isDisposed || ( !fireOnInputDisabled && !target.inputEnabled ) ) { + if ( target.isDisposed || ( !fireOnInputDisabled && trailInputDisabled ) ) { continue; }