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

(pan) event deltaY is wrong #12913

Closed
edoardoo opened this issue Sep 17, 2017 · 5 comments
Closed

(pan) event deltaY is wrong #12913

edoardoo opened this issue Sep 17, 2017 · 5 comments

Comments

@edoardoo
Copy link

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x ] 3.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
In a mobile Chrome browser (and Android webview), (pan) listener on a tag returns a wrong $event.deltaY value, until it completely stop to receive events.

Expected behavior:
In a mobile Chrome browser (and Android webview), (pan) listener is called constantly when panning the div. The event has a reasonable delta Y from the initial touch coordinates.

Steps to reproduce:

Add a (pan) listener to an element and show the value of $event.deltaY on the same page.
Here I've added it to the ion-content component.
https://run.plnkr.co/7NxHxrrUkV8pSFH8/

Related code:

Other information:

Tested on

  • Nexus 5x Oreo 8.0.0, Chrome 60.0.3112.116
  • Chrome Desktop, Version 60.0.3112.113 (Official Build) (64-bit)

Works smoothly on Firefox Mobile and Firefox Desktop 55.0.3 (64-bit) for Mac.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/Users/edo/.nvm/versions/node/v6.9.1/lib/node_modules)

    @ionic/cli-utils  : 1.10.2
    ionic (Ionic CLI) : 3.10.3

global packages:

    Cordova CLI : 6.3.1

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 5.2.2
    Ionic Framework    : ionic-angular 3.6.1

System:

    Node : v6.9.1
    npm  : 3.10.8
    OS   : macOS Sierra
@kensodemann
Copy link
Member

Hello! Thank you for opening an issue with us!

I get a server error when I try to use your plnkr. Can you double check the URL you posted?

Another good option is to provide your app via StackBlitz (this is probably the easiest option) or posting a sample application via GitHub.

Thanks for using Ionic!

@edoardoo
Copy link
Author

@kensodemann
Sorry, here is a working link: http://run.plnkr.co/plunks/1fEPnHrpr3lFGeUPt7uU/

@edoardoo
Copy link
Author

edoardoo commented Sep 18, 2017

I've investigated a bit and it might looks like its hammer.js bug:
hammerjs/hammer.js#1050

And the fix they suggest is to add this line to the element you want to catch the pan of:

touch-action: none !important;

Which, for the records, worked for me.
EDIT:
The event fires with the right values now, but in a laggish/unresponsive way. So sometimes it takes seconds to get the first event.

@kensodemann
Copy link
Member

Hello! Thank you for for the updated information. Since this is not an Iconic Framework issue, I am going to close this issue.

Thank you for using Ionic

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 2, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants