Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beforetoggle and toggle should be ToggleEvent not Event #1969

Open
johanrd opened this issue Apr 4, 2025 · 1 comment
Open

beforetoggle and toggle should be ToggleEvent not Event #1969

johanrd opened this issue Apr 4, 2025 · 1 comment

Comments

@johanrd
Copy link

johanrd commented Apr 4, 2025

I'd expect beforetoggle and toggle events to have event.newState and event.oldState from ToggleEvent (which Inherits from Event.)

interface GlobalEventHandlersEventMap {
-"beforetoggle": Event;
+"beforetoggle": ToggleEvent;
-"toggle": Event;
+"toggle": ToggleEvent;

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/beforetoggle_event) */
-declare var onbeforetoggle: ((this: Window, ev: Event) => any) | null;
+declare var onbeforetoggle: ((this: Window, ev: ToggleEvent) => any) | null;

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/toggle_event) */
-declare var ontoggle: ((this: Window, ev: Event) => any) | null;
+declare var ontoggle: ((this: Window, ev: ToggleEvent) => any) | null;

interface GlobalEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/beforetoggle_event) */
-    onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
+    onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/toggle_event) */
-    ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
+    ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
@johanrd johanrd changed the title beforetoggle and toggle´ should be ToggleEvent not Event` beforetoggle and toggle should be ToggleEvent not Event Apr 4, 2025
@Bashamega
Copy link
Contributor

Bashamega commented Apr 5, 2025

Hello @johanrd :)
Thank you for reporting this issue. I will open a PR this week to fix this issue. If you want you can open a PR for it

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

No branches or pull requests

2 participants