Skip to content
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

PhET-iO instrumentation for GrabDragInteraction #720

Closed
zepumph opened this issue Jan 25, 2022 · 8 comments
Closed

PhET-iO instrumentation for GrabDragInteraction #720

zepumph opened this issue Jan 25, 2022 · 8 comments

Comments

@zepumph
Copy link
Member

zepumph commented Jan 25, 2022

From phetsims/friction#236 (comment), it would be good to understand if there is anything to add to the interoperability. In general, I feel like this isn't. A design meeting may be nice though.

@arouinfar
Copy link

@zepumph there needs to be a way to disable the GrabDragInteraction pressListener. Otherwise, you can do something like set atomDragArea.inputEnabledProperty to false, but it will still be focusable and provide the "Space to Grab or Release" hint which won't actually work.

zepumph added a commit that referenced this issue Mar 1, 2022
zepumph added a commit to phetsims/friction that referenced this issue Mar 1, 2022
@zepumph
Copy link
Member Author

zepumph commented Mar 1, 2022

I added an enabledProperty to GrabDragInteraction. It mimics the opt-in approach used in PressListener/DragListener. This doesn't directly address the concern you had in #720 (comment). This is because of how inputEnabled is set up to work. That doesn't block focus events at this time. I created phetsims/scenery#1369 to discuss this more.

@zepumph
Copy link
Member Author

zepumph commented Mar 1, 2022

For right now, please go to friction.frictionScreen.view.atomicView.grabDragInteraction.enabledProperty to try out the enabledProperty, which believe has the desired effect.

@zepumph
Copy link
Member Author

zepumph commented Mar 3, 2022

Hide the grab cue when inputEnabled is false.

@zepumph
Copy link
Member Author

zepumph commented Mar 4, 2022

Alright. I have updated the cues to hide if inputEnabled:false. @arouinfar would you please take another look at this? Close if all is well.

@arouinfar
Copy link

Thanks @zepumph, I've confirmed that the cues are hidden when inputEnabledProperty is false.

@zepumph
Copy link
Member Author

zepumph commented Jul 8, 2022

Reopening. I think it would be much nicer if toggling inputEnabled on the micro view just changed the grabDragInteraction itself. This means that we can simplify this grab drag interaction instrumentation by making it phetioReadOnly in general. Why would someone want to turn off the keyboard input while keeping other input on? That doesn't seem like the granularity to support.

@zepumph zepumph reopened this Jul 8, 2022
@zepumph
Copy link
Member Author

zepumph commented Jul 8, 2022

Actually, I'll just have this work done over in phetsims/friction#285, but will reference over here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants