react-native-actions-sheet
react-native-actions-sheet copied to clipboard
Action sheet opens only once on android if "animated" set to false
Steps to reproduce:
- Init an empty react-native app
- npm install react-native-actions-sheet
- Put the following code to App.tsx :
import React from 'react';
import {SafeAreaView, Text, TouchableOpacity, View} from 'react-native';
import ActionSheet, {SheetManager} from 'react-native-actions-sheet';
const App = () => {
return (
<SafeAreaView>
<TouchableOpacity
onPress={() => {
SheetManager.show('action-sheet');
}}>
<Text>Open action sheet</Text>
</TouchableOpacity>
<ActionSheet id={'action-sheet'} animated={false}>
<View>
<Text style={{color: 'black', margin: 20}}>Action sheet</Text>
</View>
</ActionSheet>
</SafeAreaView>
);
};
export default App;
- Press on text to open action sheet, then press anywhere to close it. Then press on the text again - Nothing shown, but the screen became just darker. Press on the screen again and the darkness disappears. Then you can infinitely try to open ActionSheet - no success. It's shown again only on app restart (strictly speaking, it works again when component is recreated, e.g. you can put it inside a Screen in react-navigation and when the screen is removed and then created again - ActionSheet starts working, but anyway just once).
If we remove animated={false} - everything works. OS Version: Android 12 Device: Samsung Galaxy S20 FE