-
Notifications
You must be signed in to change notification settings - Fork 6
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
multi-touch: cancel interactions when switching screens #70
Comments
Somewhat similar to phetsims/scenery#109, which deals with what to do when the "Reset All" button is pressed while manipulating an object. |
@jonathanolson recommended in Skype: discussing general canceling, and when it should happen by default. for instance, if a Node is removed from the tree / set invisible, should its listeners be notified? |
Can this be handled centrally in scenery? Like scenery.scene.cancelAllInput()? |
It will require some Scenery input work to handle nicely. |
@ariel-phet, this is also a probably-multi-day issue tagged for the redeploy, should I bump up the priority of this Scenery work (currently tagged as medium priority)? |
Removed redeploy label since we're not running into it much right now. |
5/28/15 dev meeting: @ariel-phet said "don’t worry about it for now". |
I attempted to reproduce this issue on Beer's Law lab on iPad2 iOS 9.3.5 and it is not longer present, I can switch screens while manipulating objects with no obvious consequences. Closing |
Reopening. It's probably no longer present in Beer's Law Lab because I worked around it in client code. Depending on how the client implements interaction, I still stand by my original statement: "This is a general problem with multi-touch that affects all sims." There needs to be common-code support for cancelling interactions, and that support needs to be wired into joist for screen switching. Unfortunately there is still no such common-code support. The plan is to address this in scenery, but the issue hasn't gotten any traction (see phetsims/scenery#218, over 3 years old). My recommendation is to leave this issue open, so that if/when phetsims/scenery#218 gets some love, we remember to wire it into joist. |
I renamed this issue to indicate what we need to remember to do. |
@jonathanolson Now that we have an API for canceling interactions... Your thoughts on how to cancel interactions when switching screens? It seems like this is something that should be handled automatically in joist, whenever screen selection changes. |
I wonder if it should be even more general and handled in scenery. Something like "when a node is no longer in the scene graph, interaction is automatically cancelled". Not sure if we would need to expand this to "no longer in the scene graph or visible". |
Yes, presumably Joist would call interruptSubtreeInput on the screenView and any listeners using this (phetsims/scenery#131) would handle it properly. |
I had thought about that, but was concerned enough about when children of a node is changed, it triggers removal of everything and then adds everything (potentially adding nodes back), and figured that would break things. |
OK it sounds good to have explicit triggers for breaking interaction, but we should make sure it is general and flexible so it works for screens/scenes or other types of modal behavior. |
@jonathanolson and @pixelzoom will talk about this. |
4/27/17 dev meeting: @jonathanolson and I will talk about ways to do this. |
Skype:
So this may have been handled. |
@jonathanolson indicated "haven't tested fully" and I'm unclear on how to test. So unassigning myself for now. Feel free to assign to me if this needs future test or review. |
This has been handled since 6/12/2017 by Sim.js, using scenery's // When the user switches screens, interrupt the input on the previous screen.
// See https://github.com/phetsims/scenery/issues/218
this.currentScreenProperty.lazyLink( function( newScreen, oldScreen ) {
if ( oldScreen === null ) {
self.homeScreen.view.interruptSubtreeInput();
}
else {
oldScreen.view.interruptSubtreeInput();
}
} ); See also phetsims/scenery#218 and b35547e. So... closing |
This is a general problem with multi-touch that affects all sims.
First reported by @orejolaphet in this beers-law-lab issue: phetsims/beers-law-lab#57.
If you change between screens while interacting with an object, that object will freeze and be immovable when you return to that screen. Resetting the screen will move objects to original position, but the object will still be frozen. You can also freeze the reset button and the selections to different screens themselves. The only way to correct the problem is to reload the sim.
The text was updated successfully, but these errors were encountered: