Fixed issue #41: Scroll inside draggable elements contents doesn't work on iPad#204
Open
RandScullard wants to merge 6 commits intofurf:masterfrom
Open
Fixed issue #41: Scroll inside draggable elements contents doesn't work on iPad#204RandScullard wants to merge 6 commits intofurf:masterfrom
RandScullard wants to merge 6 commits intofurf:masterfrom
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) |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.