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

Panning with keyboard navigation breaks when switching screens while a moveable object has focus #210

Closed
Nancy-Salpepi opened this issue Jun 14, 2024 · 4 comments
Assignees
Labels
dev:alt-input type:bug Something isn't working

Comments

@Nancy-Salpepi
Copy link

Test device
MacBook Air M1 chip

Operating System
14.5

Browser
Safari and Chrome

Problem description
For phetsims/qa#1095, on all sims and all screens, if I change screens using the mouse while a moveable object, such as a block or scale, has keyboard focus, when I return to that screen I am unable to pan with keyboard navigation.
This may be a moot point now since we are switching to grab drag interaction, but still thought I should report this.

Seems specific to these sims. I also tested FEL on main and didn't see this problem when moving the magnet.

Steps to reproduce
Here is an example:

  1. In Buoyancy: on the Compare screen tab to block 1A
  2. While the block has keyboard focus, click on the Explore screen icon with your mouse
  3. Click on the Compare screen icon with your mouse
  4. Tab to the block again and zoom in
  5. Move the block offscreen

Visuals

panningBroken.mp4
@samreid
Copy link
Member

samreid commented Jun 17, 2024

This may be a moot point now since we are switching to grab drag interaction,

Good point, let's put this on hold until after #209

@samreid samreid removed their assignment Jun 17, 2024
@zepumph zepumph removed their assignment Jun 17, 2024
@samreid samreid self-assigned this Aug 13, 2024
@samreid
Copy link
Member

samreid commented Aug 13, 2024

Same problem now that we have GrabDragInteraction. Not sure how to solve it. @jessegreenberg or @zepumph any recommendations how to investigate?

@samreid samreid assigned jessegreenberg and zepumph and unassigned samreid Aug 13, 2024
@jessegreenberg
Copy link
Contributor

jessegreenberg commented Aug 14, 2024

One thing I noticed is that the focused Node has infinite Bounds. The AnimatedPanZoomListener won't be able to pan to keep that target in view.

image

Every once in a while, I noticed the bounds become finite and the problem went away. I would see the focus highlight jostle a little bit and wrap tightly around the mass graphic. Then it would shift away. This might be related to #209 (comment) and #327

If the infinite bounds cannot be fixed, let me know and we can explore workarounds in scenery.

@zepumph
Copy link
Member

zepumph commented Aug 20, 2024

Thanks for the lead @jessegreenberg. That was really helpful. This was the chunk of code that was breaking things:

df2334f#diff-ef1ad0c1582c6f2a99055c4065e1a884457a370ee52ec8d8017cc7d79e679cdcL192-L195

This is fixed now. Closing.

@zepumph zepumph closed this as completed Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev:alt-input type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants