Skip to content

Commit 5ddf00e

Browse files
sunnylqmfacebook-github-bot
authored andcommitted
Fix android modal not disappear when reload (#27542)
Summary: Fixes #17986 See above issue After apply this change: ![ezgif-4-45d9add85b74](https://user-images.githubusercontent.com/615282/70987576-2520ad00-20fb-11ea-9b90-c9a7839824a5.gif) ## Changelog [Android] [Fixed] - Fix android modal not disappear when reload Pull Request resolved: #27542 Test Plan: Open a modal and do a refresh to see whether it disappears Differential Revision: D19178803 Pulled By: mdvacca fbshipit-source-id: 61894927fc481650804b2196df06a80c16b64e6c
1 parent 5fc3b44 commit 5ddf00e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
9696
// Do nothing as we are laid out by UIManager
9797
}
9898

99+
@Override
100+
protected void onDetachedFromWindow() {
101+
super.onDetachedFromWindow();
102+
dismiss();
103+
}
104+
99105
@Override
100106
public void addView(View child, int index) {
101107
UiThreadUtil.assertOnUiThread();

0 commit comments

Comments
 (0)