Skip to content

fix: change event types from MouseEvent to PointerEvent #2016

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

Merged
merged 2 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10099,7 +10099,7 @@ interface GlobalEventHandlersEventMap {
"canplay": Event;
"canplaythrough": Event;
"change": Event;
"click": MouseEvent;
"click": PointerEvent;
"close": Event;
"compositionend": CompositionEvent;
"compositionstart": CompositionEvent;
Expand Down Expand Up @@ -10244,7 +10244,7 @@ interface GlobalEventHandlers {
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/click_event)
*/
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
Expand Down Expand Up @@ -30196,7 +30196,7 @@ declare var onchange: ((this: Window, ev: Event) => any) | null;
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/click_event)
*/
declare var onclick: ((this: Window, ev: MouseEvent) => any) | null;
declare var onclick: ((this: Window, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
declare var onclose: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
Expand Down
6 changes: 3 additions & 3 deletions baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10089,7 +10089,7 @@ interface GlobalEventHandlersEventMap {
"canplay": Event;
"canplaythrough": Event;
"change": Event;
"click": MouseEvent;
"click": PointerEvent;
"close": Event;
"compositionend": CompositionEvent;
"compositionstart": CompositionEvent;
Expand Down Expand Up @@ -10234,7 +10234,7 @@ interface GlobalEventHandlers {
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/click_event)
*/
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
Expand Down Expand Up @@ -30174,7 +30174,7 @@ declare var onchange: ((this: Window, ev: Event) => any) | null;
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/click_event)
*/
declare var onclick: ((this: Window, ev: MouseEvent) => any) | null;
declare var onclick: ((this: Window, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
declare var onclose: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
Expand Down
6 changes: 3 additions & 3 deletions baselines/ts5.6/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10099,7 +10099,7 @@ interface GlobalEventHandlersEventMap {
"canplay": Event;
"canplaythrough": Event;
"change": Event;
"click": MouseEvent;
"click": PointerEvent;
"close": Event;
"compositionend": CompositionEvent;
"compositionstart": CompositionEvent;
Expand Down Expand Up @@ -10244,7 +10244,7 @@ interface GlobalEventHandlers {
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/click_event)
*/
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
Expand Down Expand Up @@ -30196,7 +30196,7 @@ declare var onchange: ((this: Window, ev: Event) => any) | null;
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/click_event)
*/
declare var onclick: ((this: Window, ev: MouseEvent) => any) | null;
declare var onclick: ((this: Window, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
declare var onclose: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
Expand Down
6 changes: 3 additions & 3 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
{
"name": "auxclick",
"type": "MouseEvent"
"type": "PointerEvent"
},
{
"name": "beforeinput",
Expand All @@ -70,7 +70,7 @@
},
{
"name": "click",
"type": "MouseEvent"
"type": "PointerEvent"
},
{
"name": "compositionstart",
Expand Down Expand Up @@ -198,7 +198,7 @@
},
{
"name": "contextmenu",
"type": "MouseEvent"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmmm actually contextmenu and auxclick already has PointerEvent? 🤔 In that case we can remove contextmenu and auxclick here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, no, they were being overwritten in the overridingTypes, I have just removed them from there.

"type": "PointerEvent"
},
{
"name": "toggle",
Expand Down
8 changes: 0 additions & 8 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@
"name": "animationstart",
"type": "AnimationEvent"
},
{
"name": "auxclick",
"type": "PointerEvent"
},
{
"name": "cut",
"type": "ClipboardEvent"
Expand All @@ -77,10 +73,6 @@
"name": "copy",
"type": "ClipboardEvent"
},
{
"name": "contextmenu",
"type": "PointerEvent"
},
{
"name": "paste",
"type": "ClipboardEvent"
Expand Down