Skip to content

Commit

Permalink
simpler test for isTouchLike, see #689
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Mar 19, 2021
1 parent b7ef3ac commit faba752
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions js/HomeScreenButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ class HomeScreenButton extends VBox {
// touchdown, see https://github.com/phetsims/joist/issues/624
const buttonFired = () => {

// TODO: Why doesn't the following work? Seems like it should. See https://github.com/phetsims/joist/issues/689.
// const pointerIsTouchLike = fireListener.pointer && fireListener.pointer.isTouchLike();
const pointerIsTouchLike = fireListener.overPointers.length === 1 && fireListener.overPointers[ 0 ].isTouchLike();
const pointerIsTouchLike = fireListener.pointer && fireListener.pointer.isTouchLike();

if ( isSelectedProperty.value && ( !pointerIsTouchLike || buttonWasAlreadySelected ) ) {

Expand Down

0 comments on commit faba752

Please sign in to comment.