Skip to content

Make eventInitDict param optional in GamepadEvent constructor#217

Merged
marcoscaceres merged 4 commits intogh-pagesfrom
gamepadevent-optional-param
Feb 13, 2026
Merged

Make eventInitDict param optional in GamepadEvent constructor#217
marcoscaceres merged 4 commits intogh-pagesfrom
gamepadevent-optional-param

Conversation

@nondebug
Copy link
Copy Markdown
Collaborator

@nondebug nondebug commented Oct 10, 2024

Closes #216

The following tasks have been completed:

  • Modified Web platform tests (link to pull request)

Implementation commitment:


Preview | Diff

@tcl3
Copy link
Copy Markdown

tcl3 commented Sep 2, 2025

Should the type of the gamepad attribute also be nullable, since it can now return null?

@marcoscaceres
Copy link
Copy Markdown
Member

@tcl3, yes, good catch. I think the attributes are required to mirror the value they are initialized with.

@weinig
Copy link
Copy Markdown

weinig commented Jan 19, 2026

Other than matching current implementations, is there a reason/use case for a null gamepad on GamepadEvent. In WebKit at least, the engine will never create a GamepadEvent with a null Gamepad (other than in this case where the user constructs it from JS). Is there reason to think there is a compat issue with fixing engines to require it?

@marcoscaceres marcoscaceres merged commit d8c7780 into gh-pages Feb 13, 2026
1 of 2 checks passed
@marcoscaceres marcoscaceres deleted the gamepadevent-optional-param branch February 13, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eventInitDict parameter in GamepadEvent constructor should be optional

4 participants