Skip to content

Commit

Permalink
respect inputEnabled up the trail, not just at the leaf-most node, #1116
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Mar 11, 2021
1 parent a1542b5 commit 114fec8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 114fec8

Please sign in to comment.