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

Lock touch direction to avoid change on scroll #580

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

Conversation

naikipl
Copy link

@naikipl naikipl commented Jul 2, 2019

Fixes #308

The onStart trigger is moved from onTouchStart to onTouchMove because we need to act on drag direction. The goal being: If the first touch move is in the correct slider direction, trigger onStart; Otherwise, ignore further dragging.

Added onTouchEnd for cleanup.

As a result, the following user actions will no longer move a slider:

  • touching the track
  • dragging a horizontal slider vertically
  • dragging a vertical slider horizontally

@naikipl naikipl changed the title Touch direction Lock touch direction Jul 2, 2019
@naikipl naikipl changed the title Lock touch direction Lock touch direction to avoid change on scroll Jul 2, 2019
@codecov
Copy link

codecov bot commented Jul 2, 2019

Codecov Report

Merging #580 into master will increase coverage by 0.81%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #580      +/-   ##
========================================
+ Coverage   95.18%    96%   +0.81%     
========================================
  Files           2      2              
  Lines          83    100      +17     
  Branches       25     31       +6     
========================================
+ Hits           79     96      +17     
  Misses          4      4
Impacted Files Coverage Δ
src/utils.js 95.69% <100%> (+0.96%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a1be18...c2dc210. Read the comment docs.

@yoyo837
Copy link
Member

yoyo837 commented Apr 15, 2023

Rebase please.

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.

Slider reacting to wrong gesture on touch devices
2 participants