phetsims / friction

"Friction" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/friction
GNU General Public License v3.0
4 stars 6 forks source link

InputEnabled vs grabDragInteraction enabled #285

Closed KatieWoe closed 2 years ago

KatieWoe commented 2 years ago

Device Dell OS Win 11 Browser Chrome Problem Description For https://github.com/phetsims/qa/issues/791 In studio, I noticed that if you want to disable dragging for the zoomed out book you use friction.frictionScreen.view.topBookNode.inputEnabledProperty but if you want to disable dragging in the zoomed in book friction.frictionScreen.view.atomicView.grabDragInteraction.enabledProperty doesn't work instead you need to use friction.frictionScreen.view.atomicView.atomDragArea.inputEnabledProperty. This seems inconsistent to me.

KatieWoe commented 2 years ago

I think I had things a bit mixed up, so this may not be a bug. But I am confused as to what grabDragInteraction.enabledProperty does?

zepumph commented 2 years ago

Yes I agree this is confusing. It is best to just toggle friction.frictionScreen.view.atomicView.atomDragArea.inputEnabledProperty , and then the keyboard interaction for the atomicView drag area also turns off, see https://github.com/phetsims/scenery-phet/issues/720. I made it the same way with the friction.frictionScreen.view.topBookNode.inputEnabledProperty controlling the macro grabDragInteraction too.

@arouinfar, does this seem reasonable to you? Note that grabDragInteraction.enabledProperty is the phetioReadOnly: true, but toggling the inputEnabledProperty will dissallow keyboard interaction too.

arouinfar commented 2 years ago

Sounds good to me @zepumph.

zepumph commented 2 years ago

Perfect. Above I fixed GFL as well, which actually didn't have inputEnabled instrumented (in a buggy way) even though we wanted it, and we were passing the option through. I fixed it above!