Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing all open modals. #11

Open
izakfilmalter opened this issue Sep 19, 2022 · 1 comment
Open

Closing all open modals. #11

izakfilmalter opened this issue Sep 19, 2022 · 1 comment

Comments

@izakfilmalter
Copy link

izakfilmalter commented Sep 19, 2022

It seems really hard to close all open modals. I have two modals that are open using stackBehavior: 'replace'.
The second modal contains a form that navigates to a different screen on submit. When I submit, it navigates to the new screen, and then opens the old modal again.

I have tried calling dismissAll from useBottomSheetModal. I have tried doing calling Navigation.goBack() and then Navigation.navigate.

@izakfilmalter
Copy link
Author

izakfilmalter commented Sep 19, 2022

Did some more testing. Tried doing navigation.replace, didn't work. Seems like we need some way to override the following:

  const onDismiss = React.useCallback(() => {
    // BottomSheetModal will call onDismiss on unmount, be we do not want that since
    // we already popped the screen.
    if (isMounted.current) {
      navigation.goBack();
    }
  }, [navigation]);

Maybe an exit all modals function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant