dancormier / react-native-swipeout

iOS-style swipeout buttons behind component
MIT License
2.62k stars 646 forks source link

How to disable parent scrolling inside a <Swipeout/> Component ? #254

Open julestruong opened 6 years ago

brunobely commented 6 years ago

Also looking for this. Documentation says scroll property takes a function...

Milesyan commented 6 years ago

Last comment in https://github.com/dancormier/react-native-swipeout/issues/179

<Swipeout>
    scroll={(scrollEnabled) => { this.setState({ scrollEnabled }); }}
    ...
</Swipeout>

<FlatList
    scrollEnabled={this.state.scrollEnabled}
    ...
</FlatList>
findmory commented 5 years ago

i did it like this:

<Swipeout>
    scroll={() => { this.setState({ scrollEnabled: false }); }}
        onClose={() => { this.setState({ scrollEnabled: true }); }}
    ...
</Swipeout>

<FlatList
    scrollEnabled={this.state.scrollEnabled}
    ...
</FlatList>