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

fix: correct the clientX and clientY of touch sensor events #423

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zjffun
Copy link
Contributor

@zjffun zjffun commented Jul 24, 2020

This will bring a breaking change! Because it will change the clientX and clientY of each SensorEvent triggered by touchs.

This PR fixes the clientX and clientY of the touch sensor events.

This PR closes the following issues... (if applicable)

No

Does this PR require the Docs to be updated?

No

Does this PR require new tests?

Yes

This branch been tested on... (click all that apply / add new items)

Browsers:

  • Chrome version
  • Firefox version
  • Safari version
  • IE / Edge version
  • iOS Browser version
  • Android Browser version

@zjffun
Copy link
Contributor Author

zjffun commented Jul 24, 2020

It was written this way from the beginning. Is there any compatibility reason to use page instead of client? @tsov

@zjffun zjffun force-pushed the fix/touchsensor-client-coordinate branch from cf1a703 to 6df492f Compare July 24, 2020 11:57
@zjffun zjffun mentioned this pull request Aug 3, 2020
6 tasks
@bahung1221
Copy link
Contributor

bahung1221 commented Aug 15, 2020

Hi @zjffun , @tsov .
How about this PR? I tried it and it seems everything worked fine.

In my opinion, page and client coordinate only used to calculate internal state of draggable instance and some internal plugins. So for users, I think it won't create a breaking change 😄 Of course, we must test it carefully.

And based on zjffun PR, we can see that change from Page to Client will remove some redundant calculation (Mirror Plugin, Scrollable Plugin).

If we don't have any compatibility reason to use page instead of client, I think we should consider this PR 🤔

@zjffun
Copy link
Contributor Author

zjffun commented Aug 15, 2020

@zjffun
Copy link
Contributor Author

zjffun commented Aug 25, 2020

It seems that using client and page - scroll has the same effect. https://codepen.io/1010543618/pen/bGpqwqm

Both of them have the little bug that should fix by webkit when dragging and scrolling.

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.

2 participants