octopitus / rn-sliding-up-panel

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

Allow panel to 'persist' when clicking on an active backdrop #195

Open andrewtrac-gigeco opened 3 years ago

andrewtrac-gigeco commented 3 years ago

Issue Description

Currently by default, the hide() method is triggered if you click on an active backdrop. As per the documentation: "this method is triggered if you touch the backdrop (If it's visible)."

Is there any solution/workaround to allow the panel to 'persist' on show while the user clicks on an active backdrop? Meaning that the panel should only trigger hide() method by directly calling the method, and nothing else.

This feature would be helpful as users navigate the backdrop from clicking one item to the next.


  <SlidingUpPanel
        ref={c => this._panel = c}
        snappingPoints={[360]}
        height={240}
        friction={0.5}
        backdropOpacity={0}
        draggableRange={{ top, bottom }}
      >
        <View style={styles.swipePanel}>
          <View style={styles.panelHeader}>
            <Text>Content Header and Filters</Text>
          </View>
        </View>
      </SlidingUpPanel>

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  loadingIndicator: {
    position: "absolute",
    top: "50%",
    alignSelf: "center",
  },
  swipePanel: {
    flex: 1,
    backgroundColor: "white",
  },
  panelHeader: {
    height: 70,
    backgroundColor: Colors.backgroundColor,
    justifyContent: "flex-end",
    padding: 24,
  },
});