Question

I'm implementing dragging and dropping of list items in a Dojo mobile app. I use dojo.gesture.tap.hold to initiate the dragging. However, the page scrolls when you start dragging.

The list is inside a ScrollableView.

Is there a way to deactivate scrolling while dragging?

Was it helpful?

Solution

Sigh, I found the answer. Get a hold on the ScrollableView, override the onBeforeScroll event handler and return a boolean to indicate whether the view should scroll or not.

Example:

var scrollView = dijit.registry.byId("myScrollableView");
scrollView.onBeforeSCroll = function(evt) {
  return shouldTheViewScroll();
}

OTHER TIPS

You can also set the disableTouchScroll attribute of the ScrollableView to true/false as needed. This is not documented (and yes that should be fixed), but it should work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top