Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(android): nested dialogs #9495

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

Merged
merged 1 commit into from
Aug 4, 2021
Merged

Conversation

NathanWalker
Copy link
Contributor

PR Checklist

What is the current behavior?

Android dialogs/fragments handled inside nested views can crash.

What is the new behavior?

Android dialogs/fragments handled inside nested views no longer crash.

@cla-bot cla-bot bot added the cla: yes label Aug 3, 2021
Copy link
Member

@triniwiz triniwiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NathanWalker NathanWalker merged commit 4c547bb into master Aug 4, 2021
@NathanWalker NathanWalker deleted the fix/android-nested-dialogs branch August 4, 2021 04:57
@farfromrefug
Copy link
Collaborator

@NathanWalker @triniwiz i commented on this commit. I think this change is very dangerous and i think any fix you are trying to apply should be done differently. Please look closely at this.

@NathanWalker
Copy link
Contributor Author

@farfromrefug when you can switch to using core “next” tag on any developments today/tomorrow and let us know if you encounter anything.

@farfromrefug
Copy link
Collaborator

@NathanWalker i dont have any app doing that right now. And i will revert that commit in my fork. I really would advise against that change!

@edusperoni
Copy link
Contributor

@NathanWalker this PR introduced a crash for me. When closing the app via the back button and then reopening, the app crashes. I believe it's because you're saving the fragment manager reference to global and only overwritting on modal hide, so things may get messy if an app is closed and the modal was properly disposed in the first place.

Actually, it might be because I'm using bottom sheet from @farfromrefug and I believe it doesn't call the _hideNativeModalView at all.

A better solution might be setting a _dialogRoot in the modal view and iterating up the view tree until it finds a fragment or a _dialogRoot

@farfromrefug
Copy link
Collaborator

@edusperoni dont have my code right now but yes i am not calling _hideNativeModalView.
And it shows how that commit can crash for any plugin not relying on that method

NathanWalker added a commit that referenced this pull request Aug 11, 2021
farfromrefug pushed a commit that referenced this pull request Aug 11, 2021
NathanWalker added a commit that referenced this pull request Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants