Skip to content

Fix: Add support to alias x and y to MouseEvent#3472

Closed
ViniciusFXavier wants to merge 1 commit intojsdom:masterfrom
ViniciusFXavier:master
Closed

Fix: Add support to alias x and y to MouseEvent#3472
ViniciusFXavier wants to merge 1 commit intojsdom:masterfrom
ViniciusFXavier:master

Conversation

@ViniciusFXavier
Copy link
Copy Markdown
Contributor

@ViniciusFXavier ViniciusFXavier commented Dec 17, 2022

Add support to alias x and y to MouseEvent

Fix created to solve the problem where it does not return the x and y attributes of the MouseEvent interface.

When the following script runs, we get the attributes as a result.

const event = new MouseEvent("click", {
  clientX: 10,
  clientY: 20,
});
const { x, y, clientX, clientY } = event;
console.log(`x: ${x}`);
console.log(`y: ${y}`);
console.log(`clientX: ${clientX}`);
console.log(`clientY: ${clientY}`);

image

image
Interface of reference: https://www.w3.org/TR/cssom-view-1/#extensions-to-the-mouseevent-interface

image
Reference: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent

This fixes #3470

@ViniciusFXavier ViniciusFXavier marked this pull request as draft December 17, 2022 05:20
@domenic
Copy link
Copy Markdown
Member

domenic commented Jan 7, 2023

Looks like #3484 supersedes this and, unlike this PR, passes the build, so I'll close this.

@domenic domenic closed this Jan 7, 2023
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.

MouseEvent: x and y support

2 participants