Jordan
Jordan

Reputation: 1013

Disable Scrollview in Famo.us

How can I disable and re-enable dragging on a scrollview in Famo.us?

Docs here

Upvotes: 0

Views: 83

Answers (1)

IjzerenHein
IjzerenHein

Reputation: 2755

I can imagine any of these methods would work:

  • Unpipe the events from the all Surfaces/Views to the scrollview, this would effectively make it unresponsive to user-input.
  • Set 'pointer-events: none' for all the surfaces in the scrollView.
  • Create a proxy EventHandler and pipe the events from the surfaces to that EventHandler and then you can pipe/unpipe those events to the ScrollView.

I don't think there is an easier way to do this with the stock ScrollView though..

Alternatively, you could use the FlexScrollView, which contains an option for it:

var scrollView = new FlexScrollView({
  enabled: true
});

// disable
scrollView.setOptions({
  enabled: false
});

Tutorial: https://github.com/IjzerenHein/famous-flex/blob/master/tutorials/FlexScrollView.md

Upvotes: 1

Related Questions