-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] function pickers are not working #29
Comments
This is a showstopper. |
It seems touch-specific (I can also reproduce in "device mode" on Chrome), and event.handle shouldn't* have any differences between mouse and touch. It looks likely that touch-to-snag is enabled on the function bodies themselves, so that after the touch-down triggers the picker, any movement afterwards triggers the drag on the function body. |
(Will be investigating how to fix). |
It does seem that Additionally, the 'trail' parameter to the event listener should be removed, as Scenery just calls eventListener( event ) without a second parameter. |
The "movables" in the sim are cards and functions. Since interaction with cards and functions is similar, I'm fairly certain that we should have touch snag for all or nothing. And it would seem odd to have touch snag for some functions but not others. So... options: The first 2 options are the "all or nothing" extremes: (1) Try to fix the problem so that we can have (2) Set The other options are compromises: (3) Set (4) Set Since this issue is not specific to this sim, my recommendation is option (1), pursue a fix. I don't like either of the compromises (3 & 4) and would probably just set @ariel-phet your input? |
@jonathanolson Are you referring to this in MathFunctionNode? Please point me to the description of the input listener API. picker.addInputListener( {
down: function( event, trail ) {
event.handle(); // don't propagate event to parent
}
} ); |
input listeners documentation: http://phetsims.github.io/scenery/doc/user-input |
The "snag" is triggered by a 'touchenter' event, from Input's enterEvents. The 'enter' event is actually sent to each individual thing that is now under the pointer (which wasn't before, which since it is a "new" pointer, is everything), and doesn't bubble (so handle() won't do anything in touchenter). Additionally, the 'enter' events happen before the 'down' event, so it's actually snagging the function node before manipulating the picker. I'll try to figure out a good general solution, as there doesn't look like an easy patch to make. |
Discussed options in #29 (comment) with @ariel-phet. @jonathanolson should continue to pursue a general fix. But as a fallback, @ariel-phet would like to try option (3) in a dev version. |
@ariel-phet here's the dev version that you requested: Cards have |
Re the above dev version... It doesn't feel too bad to me, probably a reasonable workaround until a general solution can be implemented in scenery. @ariel-phet if you agree, please change the priority of this issue to what you feel is appropriate. |
Tried on iPad, does not really seem to affect usability. If I deliberately try to swipe across a function card I can see this action does not work, but it is very natural to grab the function cards since they are so large compared to my finger. I feel very comfortable with this solution. |
Given testing and comments above, changing this to priority 5, as we have other pressing issues. |
The general issue has been moved to phetsims/scenery#547, with same priority (deferred) that @ariel-phet has specified here. Issue #49 reminds us to re-enable this feature in function-builder when scenery is fixed. Closing. |
Reported by @kathy-phet via email:
The "pickers" referred to are instances of scenery-phet.NumberPicker.
The version that @kathy-phet is testing is presumably 1.0.0-dev.26. I received no info on her iPad model, iOS version or browser version.
I reproduced the problem on iPad2 with iO 9.3.1 and mobile Safari.
Steps to reproduce:
On desktop (Safari, Chrome, Firefox), the pickers work as desired: Clicking a picker increments/decrements the value, but does not result in moving the function. The function does not move or pop out of the carousel unless you click on the function somewhere other than the picker.
On mobile Safari, "clicking" on a picker doesn't increment/decrement the value, and instead pops the function out of the carousel. If you hold the pointer down, the picker value will change.
Here's the relevant code in function-builder.MathFunctionNode:
Is it possible that
event.handle
is not working as expected for touch?Assigning to @jonathanolson with high priority, since this affects ability to use the sim.
The text was updated successfully, but these errors were encountered: