Open hoc-ht opened 4 years ago
Move the <Button title='Show panel' onPress={() => this._panel.show()} />
to below the panel should fix the issue. The reason is Button
component on Android has elevation
which sometime mess up with zIndex.
Same here. Moving the button below the panel doesn't resolve the issue. Other ideas? 🙄
Rendering the button in a different view works though.
The following works:
<SafeAreaView style={styles.wrapper}>
<StatusBar style="auto" translucent/>
<View style={styles.container}>
<Button title='Show panel' onPress={this.handleClickShowPanel} />
</View>
<SlidingUpPanel ref={this.panelRef} backdropOpacity={0.75} allowDragging={false}>
<View style={styles.panelContainer}>
<Text>Here is the content inside panel</Text>
<Button title='Hide' onPress={this.handleClickHidePanel} />
</View>
</SlidingUpPanel>
</SafeAreaView>
Compared to:
<SafeAreaView style={styles.wrapper}>
<StatusBar style="auto" translucent/>
<View style={styles.container}>
<Button title='Show panel' onPress={this.handleClickShowPanel} />
<SlidingUpPanel ref={this.panelRef} backdropOpacity={0.75} allowDragging={false}>
<View style={styles.panelContainer}>
<Text>Here is the content inside panel</Text>
<Button title='Hide' onPress={this.handleClickHidePanel} />
</View>
</SlidingUpPanel>
</View>
</SafeAreaView>
Im having same issue. I have a card component that covering the panel.
I move components around a stated but does not help. This only happens on Android. Also I notice on android the sliding is not smooth when using this._panel. only smooth slide when using finger to slide.
The main problem is that the slider is not on top when using with android
I figured out a workaround. I don't like it but it works. Two options
option 1 move the slider component to the top level of your app
Option 2 is to use a Provider and Portal which will bring any component that is wrap up to the top level making it appear over all other components.
I did this using React Native Paper Portal and Provider https://callstack.github.io/react-native-paper/portal.html
Issue Description
I think there is a zIndex issue. I tried a very simple example, but it seems the Show Panel button is overlap the panel.
Steps to Reproduce / Code Snippets / Screenshots
Environment