Touch direction locking#427
Open
DieterHolvoet wants to merge 2 commits intoreact-component:masterfrom
Open
Conversation
Author
|
I should also say that the horizontal slider with my changes has been used on a production site for about three months, everything working perfectly: https://www.klj.be/spelen/spelen-maken-of-vinden/spelendatabank |
|
Your changes work very well for me, without them the slider is basically unusable on a mobile device where the user needs to scroll up and down the page. Could you please have a look at this @yesmeck ? |
|
Any updates on this? 😬 |
|
@zombieJ I'm interested in fixing this scroll issue as well - if I'm able to fix the unit tests, would this be a candidate for merging? |
Member
|
hi @grahamcracker , since I don't familiar with touch devices. I may need others to help check on this PR. |
|
any updates on this? |
Member
|
Rebase please. |
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.
Fixes issue #308. There's still 3 tests failing and all are related to
dragOffset, but I don't really know what's wrong, so it would be nice if someone could have a look.Biggest changes
Moved a big part of the code in onTouchStart to onFirstTouchMove to be called once within onTouchMove
Reason: It is impossible to determine the direction of the swipe in onTouchStart because there's only one touch point to work with. Because of that, we have to postpone the initialization of the component to the first call of onTouchMove, because at that point we have a second touch point to calculate the swipe direction with. If the swipe is in the wrong direction, the component will never be initialized, and page scroll will work as expected.
Added dragging state with matching class
${prefixCls}-draggingReason: because of the
touch-action: noneandtouch-action: pan-xstyles, page scrolling is interrupted regardless of what the component does. I added a new css class to set these styles after the component initialized to fix scrolling issues.