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

Missing event normalization in start event handler resets position on touchscreen devices to 0 #9

Closed
kkriehl opened this issue Jan 19, 2011 · 5 comments

Comments

@kkriehl
Copy link

kkriehl commented Jan 19, 2011

Hello azoff,

you forgot to add the event normalization to the start event handler. Because of this the initial coordinates for scrolling are resetted to zero on iOS devices (testing on event.touches would probably support more touch-enabled os). Adding

o.normalizeEvent(event);

to the function resolves this problem. Though I am still missing the click event ;)

Greetings

@azoff
Copy link
Owner

azoff commented Jan 19, 2011

Awesome! I'll look into it tonight when I get a second. Since I'm kinda a noob when it comes to iOS event handling, do you think you could give me a little more context around the issue? I'm not sure if I completely understand what's going on, but this is a good start.

@kkriehl
Copy link
Author

kkriehl commented Jan 22, 2011

I'm rather new in this field myself, but more and more of our customers request iOS compatibility for their web applications so I need to deal with touchscreen handling in JavaScript (primary for the Apple iPad).
What I experienced with overscroll is that on the iPad the click event would not be generated on clickable elements inside the scrollable container even though Safari should usually emulate mouse events where applicable:

http://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html

I am not sure how exactly Safari emulates mouse events and I think that it may use the touch*-events to do so. At least in the start-handler of overscroll the start function returns false and therefore cancels any further touchstart-events, so it may be a better solution to return "true", but I haven't tried that. I have added a manual click emulation instead by firing a click() on the event target element if a touchend event occured directly after a touchstart (I added a property to track the last value of event.type and checked that in the end-function).
That workaround works for me but may not be the best solution ;).

Do you have access to an iOS device for testing? If not I could see if I can find some spare time (lunchtime or so), grab a test iPad and run some tests on mouse event emulation in iOS (I should do this anyway I think ;)).

@kkriehl
Copy link
Author

kkriehl commented Jan 22, 2011

(Oops, closed the issue by accident)

@azoff
Copy link
Owner

azoff commented Jan 24, 2011

I don't have access, but I would be forever grateful for any help you can provide!

@azoff
Copy link
Owner

azoff commented Feb 3, 2011

Implemented in 1.4.2 (will release soon!)

This issue was closed.
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

No branches or pull requests

2 participants