Closed Keithcat767 closed 1 year ago
Hi @Keithcat767,
It seems to be working for me, not sure why, you can add containerStyle={{backgroundColor: 'white'}}
to your Dialog
to make sure you see it properly.
If it is not working for you I'd try something like the following (~since you've marked iOS
~ I think this should work for both platforms):
const [showEditModal, setShowEditModal] = useState(false);
const [showActions, setShowActions] = useState(false);
const editWasPressed = useRef(false);
return (
<>
<Button label="bla" onPress={() => setShowActions(true)}/>
<Dialog useSafeArea containerStyle={{backgroundColor: 'white'}} visible={showEditModal} onDismiss={() => setShowEditModal(false)}>
<View>
<Text>TEST</Text>
</View>
</Dialog>
<ActionSheet
title={`Edit`}
message={'Message goes here'}
options={[
{
label: 'Rename',
onPress: () => {
editWasPressed.current = true;
}
},
{label: 'Cancel'}
]}
visible={showActions}
onDismiss={() => {
setShowActions(false);
}}
onModalDismissed={() => {
if (editWasPressed.current) {
editWasPressed.current = false;
setShowEditModal(true);
}
}}
/>
</>
);
We did encounter something (#2575) that may have been relevant, although we only found it to be related to RN71. Please reopen if it is still relevant.
Description
If you try to open a Dialog from an option in an ActionSheet, it doesn't seem to wait until after the ActionSheet is fully dismissed and therefore is prevented from being opened. I can confirm it works if I use setTimeout to wait long enough to open my dialog or if I use the onModalDismissed prop to attempt to open the dialog.
Related to
Steps to reproduce
Expected behavior
The dialog will open after the ActionSheet has fully dismissed.
Actual behavior
The dialog doesn't display unless you explicitly tell it to wait for the animation to finish
More Info
Code snippet
Screenshots/Video
Environment
Affected platforms