mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-19 18:36:25 +00:00
Update gamepad.js (#855)
The objects traversed by the “foreach” method should be arrays, and the “Array.from()” method should be used to convert the traversal objects to arrays, ensuring that they run in some more restrictive browsers.
This commit is contained in:
parent
e8c774c748
commit
611a8c26d6
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ class GamepadHandler {
|
|||
this.timeout = setTimeout(this.loop.bind(this), 10);
|
||||
}
|
||||
updateGamepadState() {
|
||||
const gamepads = this.getGamepads();
|
||||
const gamepads = Array.from(this.getGamepads());
|
||||
gamepads.forEach((gamepad, index) => {
|
||||
if (!gamepad) return;
|
||||
let hasGamepad = false;
|
||||
|
|
Loading…
Reference in a new issue