Skip to content

Gamepad: buttons should be Array, but is GamepadList instead #44333

@webbedspace

Description

@webbedspace

Describe the bug:
See: https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/buttons

To Reproduce:

<!doctype html>
<script>
    window.addEventListener("gamepadconnected", (e) => B.innerText=`Connected at ${Date.now()}`);
    setInterval(() => {
        let b = navigator.getGamepads()[0]?.buttons
        if (b) {
            A.innerText = b.constructor.name + ' ' + Array.isArray(b)
        }
    },500)
</script>
<pre id="B"></pre>
<pre id="A"></pre>

Servo
Image
Firefox
Image

Platform:
Windows 10

Metadata

Metadata

Assignees

Labels

A-content/domInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions