Skip to content

Commit

Permalink
updated the way key and other PDOM drags are distinguished from other…
Browse files Browse the repository at this point in the history
…s based on input from JO, see phetsims/geometric-optics#259
  • Loading branch information
jbphet committed Mar 7, 2022
1 parent b3919cb commit 9efb658
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/Slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9efb658

Please sign in to comment.