Is there a way to block ionic scroll while dragging?


#1

I created a “side cards” with additional informations about an item of a list of photos, using dragLeft dragRight etc… But, while these events is fired Ionic scroll also is fired :confused:

This is annoying and is breaking my ideia, is there someway to programatically disable Ionic scroll?

My source code is on gitHub https://github.com/felquis/instacloser and is running well on instacloser.com, in the cordova build the app is working just like in the browser.

After logged with instagram you need to drag from the right to the left of any image to see more infos about the photo.

This was discussed here Ionic-Content - Disable Vertical Scroll While Dragging


Ionic-Content - Disable Vertical Scroll While Dragging
Ionic-Content - Disable Vertical Scroll While Dragging
#2

Have you seen data-tap-disabled?

http://ionicframework.com/docs/api/page/tap/


#3

Thank you so much this is exactly what I needed. I had a rotating knob in a UI that I needed to disable scrolling while dragging.


#4

For me tapDisabled doesn’t work, as the value change isn’t applied to the current event.

I found a fairly simple solution using $ionicGesture and $ionicScrollDelegate:

$ionicGesture.on( 'drag', drag, element );
function drag( event ){
    if( conditionThatVerifiesTheUserDoesntWantToScroll ){
        $ionicScrollDelegate.freezeScroll( true );
        // Here goes the dragging logic
    }
}