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

Fixed issue #41: Scroll inside draggable elements contents doesn't work on iPad #204

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

RandScullard
Copy link

The reason scrolling wasn't working was because simulateMouseEvent was always calling preventDefault on the original touch event. This version instead calls preventDefault on the touch event only if the widget calls preventDefault on the simulated mouse event. This allows scrolling and dragging to both work on the same element. Tested with Sortable, Draggable, and Resizable.

…lt on touchstart. This avoids duplicating mouse events that the browser simulates on its own. Also improve the code to distinguish between a click and a move.
@Slumber86
Copy link

This fix broke calendars dropdowns on android 4.x

@bbmatt
Copy link

bbmatt commented May 7, 2015

The fix works, but will throw an error on first initialisation when using a mouse instead of touch.
I fixed that by requiring touchEvent on lines 209 & 226 of your fix:

if (event.isDefaultPrevented() && touchEvent)

@RandScullard
Copy link
Author

Good catch, @bbmatt. I have updated the pull request with your fix. That problem didn't show up in my application because I only load jquery-ui-touch-punch on touch-only platforms. 😞

…hat supports touch events, causing touchEvent to be undefined in _mouseDown and _mouseMove.
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.

3 participants