-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
Conversation
…t work on iPad (also update minified JavaScript)
…avoid getting two clicks.
…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.
This fix broke calendars dropdowns on android 4.x |
The fix works, but will throw an error on first initialisation when using a mouse instead of touch. if (event.isDefaultPrevented() && touchEvent) |
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.
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.