8000 fix(useGamepad): avoid spread to fix gamepad state (#3913) · vueuse/vueuse@2ccbd3d · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 2ccbd3d

Browse files
authored
fix(useGamepad): avoid spread to fix gamepad state (#3913)
1 parent d9ee4f6 commit 2ccbd3d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/core/useGamepad/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,15 @@ export function useGamepad(options: UseGamepadOptions = {}) {
8282
hapticActuators.push(...gamepad.hapticActuators)
8383

8484
return {
85-
...gamepad,
8685
id: gamepad.id,
86+
index: gamepad.index,
87+
connected: gamepad.connected,
88+
mapping: gamepad.mapping,
89+
timestamp: gamepad.timestamp,
90+
vibrationActuator: gamepad.vibrationActuator,
8791
hapticActuators,
8892
axes: gamepad.axes.map(axes => axes),
8993
buttons: gamepad.buttons.map(button => ({ pressed: button.pressed, touched: button.touched, value: button.value })),
90-
index: gamepad.index,
9194
} as Gamepad
9295
}
9396

0 commit comments

Comments
 (0)
0