octopitus / rn-sliding-up-panel

Draggable sliding up panel implemented in React Native https://octopitus.github.io/rn-sliding-up-panel/
MIT License
928 stars 157 forks source link

hide() function is not working #144

Open bbeckk opened 4 years ago

bbeckk commented 4 years ago

this._panel.hide() does nothing in the following code. However tapping outside of the panel closes it, back btn closes it but clicking the button is not working. I've tested it in android devices. How to make it work? Thankyou in advance

<SlidingUpPanel
      ref={c => this._panel = c}
      draggableRange={{top: 500, bottom: 0}}
    >
    {dragHandler => (
    <View style={[styles.container]}>
      <View {...dragHandler}>
        <TouchableOpacity
          onPress={()=> this._panel.hide()} //this code does nothing...
        >
          <Text>Close</Text>
        </TouchableOpacity>
      </View>
      <ScrollView nestedScrollEnabled={true}>
            <Text> whole body here </Text>
            </ScrollView>
    </View>
  )}
</SlidingUpPanel>