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

bug: ion-option-button should freeze list scrolling when 'swiping' #2950

Closed
mikeacook opened this issue Jan 16, 2015 · 4 comments
Closed

bug: ion-option-button should freeze list scrolling when 'swiping' #2950

mikeacook opened this issue Jan 16, 2015 · 4 comments
Assignees
Milestone

Comments

@mikeacook
Copy link

Type: bug

Platform: mobile webview

I was looking for a solution for this today, and also happened upon another person with the same problem in the forums:
http://forum.ionicframework.com/t/prevent-scrolling-while-swiping-on-ion-item/14708

@mikeacook mikeacook changed the title bug: ion-option-button should freeze list scrolling when 'swiping' bug: bug: ion-option-button should freeze list scrolling when 'swiping' Jan 16, 2015
@mikeacook mikeacook changed the title bug: bug: ion-option-button should freeze list scrolling when 'swiping' bug: ion-option-button should freeze list scrolling when 'swiping' Jan 16, 2015
@huttj
Copy link

huttj commented Feb 2, 2015

Having this problem too.

I managed to work around it by using overflow-scroll="true" on the content tag, as well as adding in a second condition in the _startDrag method (ionic.bundle.js:6878):

// Or check if this is a swipe to the side drag
else if ((!this._didDragUpOrDown && (e.gesture.direction == 'left' || e.gesture.direction == 'right') && Math.abs(e.gesture.deltaX) > 1) || (this._didDragUpOrDown && Math.abs(e.gesture.deltaY) < 4 && Math.abs(e.gesture.deltaX) > 2)) {

Before, the items would not respond, and it was hard to figure out why. Turns out it was _didDragUpOrDown being true, although the intended action was not to scroll. Adding a second check with a vertical cutoff allows just enough leeway for vertical thumb wobbling, without compromising the scrolling behavior.

In fact, it might be possible to simplify the check to include only the horizontal and vertical displacement, like so:

else if (Math.abs(e.gesture.deltaY) < 4 && Math.abs(e.gesture.deltaX) > 2) {

Seems to work without any adverse effects.

@nowcodingaway
Copy link

Any news on if this bug will be fixed in the 1.0 release?

@adamdbradley adamdbradley self-assigned this Feb 12, 2015
@adamdbradley adamdbradley added this to the 1.0.0-rc0 milestone Feb 12, 2015
@SnehaShreshtha
Copy link

I am facing similar issue in ionic2. Can you please help me with this.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 2, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants