phetsims / expression-exchange

"Expression Exchange" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 2 forks source link

make 'touch snag' work for coin term creator nodes #121

Closed jbphet closed 7 years ago

jbphet commented 7 years ago

@kathy-phet reported the following:

I noticed one thing when playing on my phone. Once in the play area the objects are swipe to pick up, but in the carousel they don't follow that behavior ... they are touch to pick up only.

Eventually we will want swipe to pick up out of the carousel I think to make phone operation easier. Even though we don't really support phones, kids use it on phones and the android app will just accelerate that use. I don't know if it is easier to do this enhancement now or you want to wait. If there was a design reason it wasn't done, just let me know.

In fact, I think it would be great if the default behavior of these carousels was swipe to pick up as this is a comment I make often. Perhaps that is a discussion for dev meeting.

jbphet commented 7 years ago

I tried adding allowTouchSnag: true to the input listener added to the creator nodes in CoinTermCreatorNode.js (currently on line 135). This didn't seem to make any difference in the behavior, and I suspect that it's because the events are being forwarded from the creator node to the created node.

@jonathanolson's - is there a way to have touch snag supported through event forwarding?

samreid commented 7 years ago

I was asked to do something similar in Circuit Construction Kit in https://github.com/phetsims/circuit-construction-kit-common/issues/371

I changed vanilla input listener to SimpleDragHandler and added allowTouchSnag:true and everything worked nicely on iPad2. I'd be happy to take a closer look at your situation if you would like to call.

samreid commented 7 years ago

I tried adding allowTouchSnag: true to the input listener added to the creator nodes in CoinTermCreatorNode.js (currently on line 135).

You will need to convert from vanilla object literal {} to using SimpleDragHandler.

jbphet commented 7 years ago

@samreid and I were able to get some time from @jonathanolson, and he helped us to add the needed forwarding calls to the object literal instead of using SimpleDragHandler. Initial testing show that it works well. I have committed this on both the 1.1 branch and master, so it should be available in the first release.

jbphet commented 7 years ago

Test has been tested and released - closing.