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

Update PointerEvent to have default width / height set to 1 #1224

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chuganzy
Copy link

@chuganzy chuganzy commented Jun 11, 2024

What:

This PR updates PointerEvent to have default width / height set to 1 as per the spec.

Why:

new PointerEvent('xxx') on most browser implementations should set them 1 by default.

Also some libraries check if a pointer event is virtual or not by looking at the geometry values, while we expect this library to work exactly as the actual interactions.

How:

Just use 1 as default values on them.

Checklist:

  • Documentation
    • Not needed?
  • Tests
  • Ready to be merged

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@@ -135,7 +135,7 @@ function initUIEvent(event: UIEvent, {view, detail}: UIEventInit) {
})
}

function initUIEventModififiers(
function initUIEventModifiers(
Copy link
Author

@chuganzy chuganzy Jun 11, 2024

Choose a reason for hiding this comment

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

Corrected as I thought this is typo?

@chuganzy chuganzy changed the title Use the original geometry in event if exist Update PointerEvent to have default width / height set to 1 Jun 11, 2024
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.

1 participant