Open jessegreenberg opened 2 years ago
That sounds totally fine, and like the way we should proceed. I would recommend making numberOfKeyboardDrags public and read-only, because we may want to use it in the future to show the drag cue for the first X drags instead of just until 1 success.
I also want to note again that I am not really much of a fan of having keyboardDragListener be a required argument. It feels much more valuable to support a grabDragInteraction that doesn't make assumptions on how the interaction is handled. I remember noting that opinion when I first discovered the refactor to support pan/zoom. This is a step towards making it even harder to get rid of that dependency, which feels less maintainable me. It is only a feeling, and so it is hard to weigh the potential of having a different sort of drag listener type in the future vs. the effort to keep things flexible now.
I assume that we will continue with your patch. An alternative would be to support a structured interface where we iterate through all listenersForDragState
, and any instance with a dragEmitter
, on it, we add this listener to. Then we wouldn't need to depend on the type KeyboardDragListener
, requiring one be provided.
What do you think about this patch that is untested, and will likely need documentation updates?
Reviewing scenery-phet issues for Q4 planning...
No progress in over year. Assigning to @kathy-phet to prioritize.
In https://github.com/phetsims/balloons-and-static-electricity/issues/534, it was requested that the drag cue node be hidden after a successful keyboard drag. This seems like a reasonable default, but the default behavior for showDragCueNode is to always be shown.
In https://github.com/phetsims/balloons-and-static-electricity/issues/534 I hade to implement create a variable that represents if there was a successful keyboard drag and then use it with option
showDragCueNode
. If this is the default behavior it would be great to support in GrabDragInteraction, is there a way we can do this? @zepumph what do you think of this?