Hi there,

is there any way of temporally disabling ScrollOnDrag in a viewport? I have a listbox containing swipe components and would like to stop vertical scrolling while swiping a row component, As far as I can see, the underlaying viewport uses a global mouse listener which means enabling interception of mouse events wouldn’t work.

Any help is much appreciated.

void setScrollOnDragEnabled (bool shouldScrollOnDrag)

what happens if you call that set to false during your initial swiping, and set it to true when you’re done swiping?

Actually that is what I am doing right now - caching and restoring the old state - but I don’t really like it for the sake of nice and clean code. Casting the parent to a possible yiewport to do this doesn’t sound right to me.

You can set the ignoreDrag flag for your listbox. Every component actually supports this. See Component::setViewportIgnoreDragFlag (bool ignoreDrag)

1 Like

That is what I was missing. Thanks a bunch!

This should probably get a mention somewhere in the documentation of viewport.

1 Like

Yep, I’ll add that. Thanks for the suggestion.