From d5da2a77adf1e982d2af7ae626c71bce93557429 Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Thu, 12 Sep 2024 09:59:28 -0600 Subject: [PATCH] more isInteractiveHighlighting conversion (oops), https://github.com/phetsims/scenery/issues/1653 Signed-off-by: Michael Kauzmann --- js/overlays/HighlightOverlay.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/overlays/HighlightOverlay.ts b/js/overlays/HighlightOverlay.ts index c39a16327..54a59c03e 100644 --- a/js/overlays/HighlightOverlay.ts +++ b/js/overlays/HighlightOverlay.ts @@ -816,10 +816,12 @@ export default class HighlightOverlay implements TOverlay { private onInteractiveHighlightChange(): void { if ( assert ) { - const interactiveHighlightNode = this.node as InteractiveHighlightingNode; - const lockedPointerFocus = this.display.focusManager.lockedPointerFocusProperty.value; - assert( interactiveHighlightNode || ( lockedPointerFocus && lockedPointerFocus.trail.lastNode() === this.node ), - 'Update should only be necessary if Node is activated with a Pointer or pointer focus is locked during interaction' ); + assert && assert( isInteractiveHighlighting( this.node ) ); + if ( isInteractiveHighlighting( this.node ) ) { + const lockedPointerFocus = this.display.focusManager.lockedPointerFocusProperty.value; + assert && assert( this.node || ( lockedPointerFocus && lockedPointerFocus.trail.lastNode() === this.node ), + 'Update should only be necessary if Node is activated with a Pointer or pointer focus is locked during interaction' ); + } } // Prefer the trail to the 'locked' highlight