NEW 273631
[visionOS] Under certain circumstances navigator.getGamepads does not reflect the current state while the Safari window is in focus
https://bugs.webkit.org/show_bug.cgi?id=273631
Summary [visionOS] Under certain circumstances navigator.getGamepads does not reflect...
Alec Bargas
Reported 2024-05-02 10:21:29 PDT
On visionOS, there are some circumstances where navigator.getGamepads stops reflecting the current state of connected gamepads even while the Safari window is in focus. The expectation is that while the window is in focus the gamepad state returned by navigator.getGamepads will reflect the current state of connected gamepads. This behavior can be seen with the https://hardwaretester.com/gamepad page. The steps to reproduce the behavior are: 1. Connect gamepad. 2. Verify that gamepad and inputs are reflected on the page. 3. Click into address bar. 4. Verify that inputs to the gamepad are not reflected on the page. 5. Dismiss keyboard using the 'X' on the floating keyboard. 6. Verify that inputs to the gamepad are reflected on the page. 7. Click back onto page. 8. Observe that gamepad updates are no longer reflected on the page. 9. Click onto the page again. 10. Verify that inputs to the gamepad are now reflected on the page. At step 4, the window is out of focus and it is expected that gamepad inputs are not updated in navigator.getGamepads. At step 5 focus is returned to the window and it is expected that at step 6 navigator.getGamepads returns the current gamepad state. At step 8, focus is still on the window and it is expected that navigator.getGamepads returns the current gamepad state even though it does not. navigator.getGamepads is still returning a state for the gamepad, it is however the last state at step 7 and does not get updated even when input on the gamepad changes. This issue reproduces in other circumstances as well, sometimes while switching focus between the Safari window and other applications. However, these seem to only reproduce the issue intermittently. The behavior on the visionOS 1.0 simulator is different. After step 3, focus is only returned to the Safari window after step 9 and the gamepad does not update until step 10. While it is more consistent, ideally it seems like focus should at least be returned to the window by step 7. This does not repro on iOS. Reproduces with: Version/17.1.4 Safari/605.1.15 (visionOS 1.0.2 physical device)
Attachments
Radar WebKit Bug Importer
Comment 1 2024-05-09 10:22:17 PDT
Alec Bargas
Comment 2 2024-08-27 14:47:15 PDT
Still able to reproduce this issue on visionOS 1.3.
Note You need to log in before you can comment on or make changes to this bug.