octopitus / rn-sliding-up-panel

Draggable sliding up panel implemented in React Native https://octopitus.github.io/rn-sliding-up-panel/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

andrewtrac-gigeco opened this issue · comments

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,
  },
});


  • Version: 2.4.4