From 9efb6587b73dd1351508fd3caba1761c8bb2412f Mon Sep 17 00:00:00 2001 From: jbphet Date: Mon, 7 Mar 2022 13:13:18 -0700 Subject: [PATCH] updated the way key and other PDOM drags are distinguished from others based on input from JO, see https://github.com/phetsims/geometric-optics/issues/259 --- js/Slider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/Slider.ts b/js/Slider.ts index 1ab041bd..653bc6a1 100644 --- a/js/Slider.ts +++ b/js/Slider.ts @@ -22,7 +22,7 @@ import merge from '../../phet-core/js/merge.js'; import optionize from '../../phet-core/js/optionize.js'; import Orientation from '../../phet-core/js/Orientation.js'; import swapObjectKeys from '../../phet-core/js/swapObjectKeys.js'; -import { DragListener, FocusHighlightFromNode, IPaint, Node, Path, SceneryConstants, SceneryEvent } from '../../scenery/js/imports.js'; +import { DragListener, FocusHighlightFromNode, IPaint, Node, Path, PDOMPointer, SceneryConstants, SceneryEvent } from '../../scenery/js/imports.js'; import Tandem from '../../tandem/js/Tandem.js'; import BooleanIO from '../../tandem/js/types/BooleanIO.js'; import IOType from '../../tandem/js/types/IOType.js'; @@ -246,7 +246,7 @@ class Slider extends AccessibleSlider( Node, 0 ) { options.drag = event => { // TODO: Is this a reasonable way to distinguish pointer events from key events? See https://github.com/phetsims/sun/issues/697. - if ( event.pointer.type === 'pdom' ) { + if ( event.pointer instanceof PDOMPointer ) { options.soundGenerator!.playSoundForValueChange( valueProperty.value, previousValue ); } else {