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

KeyboardDragListener doesn't interrupt on blur #1285

Closed
jessegreenberg opened this issue Sep 20, 2021 · 6 comments
Closed

KeyboardDragListener doesn't interrupt on blur #1285

jessegreenberg opened this issue Sep 20, 2021 · 6 comments

Comments

@jessegreenberg
Copy link
Contributor

I noticed that the KeyboardDragListener doesn't interrupt itself on blur which is surprising to me. I am using one without a GrabDragInteraction in quadrilateral and tabbing away from the Node while movement keys are down result in the pressed keys staying in the keyState array. This isn't a problem for GrabDragInteraction because of these lines
https://github.com/phetsims/scenery-phet/blob/03097363295d48e5be248c9ecbbbf29853799625/js/accessibility/GrabDragInteraction.js#L654-L665

@jessegreenberg
Copy link
Contributor Author

Fixed in the above commit, @zepumph is this change OK with you?

@zepumph
Copy link
Member

zepumph commented Sep 20, 2021

I can't think of any reason that would be bad. Thanks!

@zepumph zepumph closed this as completed Sep 20, 2021
@zepumph
Copy link
Member

zepumph commented Mar 22, 2023

Similar to this, I just saw that interrupt doesn't call end. @jessegreenberg please let me know if that seems buggy to have. It seems important to keep this implementation aligned with DragListener (from interrupt/release).

@zepumph
Copy link
Member

zepumph commented Mar 22, 2023

Ran into this over in phetsims/my-solar-system#86

@zepumph
Copy link
Member

zepumph commented Mar 22, 2023

Spot check from @jessegreenberg, I basically copied the idea from

// it is possible we are interrupting a click with a pointer press, in which case
// we are listening to the Pointer listener - do a full release in this case
if ( this._listeningToPointer ) {
this.release();
}

@jessegreenberg
Copy link
Contributor Author

This change makes sense, thank you! Looking for other cases like phetsims/friction#342, but I didn't see anything else.

Closing.

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