bug: ion-option-button should freeze list scrolling when 'swiping'
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
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.
Any news on if this bug will be fixed in the 1.0 release?
I am facing similar issue in ionic2. Can you please help me with this.
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.