yogevbd 6 years ago
parent
commit
ef4acd9fbb
2 changed files with 10 additions and 0 deletions
  1. 9
    0
      e2e/Modals.test.js
  2. 1
    0
      lib/ios/RNNModalManager.m

+ 9
- 0
e2e/Modals.test.js View File

@@ -107,4 +107,13 @@ describe('modal', () => {
107 107
     Android.pressBack();
108 108
     await expect(elementByLabel('Pushed Screen')).toBeVisible();
109 109
   });
110
+
111
+  it('present modal multiple times', async () => {
112
+    await elementById(testIDs.SHOW_MODAL_BUTTON).tap();    
113
+    await elementById(testIDs.SHOW_MODAL_BUTTON).tap();
114
+    await elementById(testIDs.DISMISS_MODAL_BUTTON).tap();
115
+    await elementById(testIDs.SHOW_MODAL_BUTTON).tap();
116
+    await elementById(testIDs.DISMISS_MODAL_BUTTON).tap();
117
+    await expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
118
+  });
110 119
 });

+ 1
- 0
lib/ios/RNNModalManager.m View File

@@ -76,6 +76,7 @@
76 76
 	if (modalToDismiss == topPresentedVC || [[topPresentedVC childViewControllers] containsObject:modalToDismiss]) {
77 77
 		[modalToDismiss dismissViewControllerAnimated:modalToDismiss.isAnimated completion:^{
78 78
 			[[_store pendingModalIdsToDismiss] removeObject:componentId];
79
+			[_store removeComponent:componentId];
79 80
 			[self removePendingNextModalIfOnTop];
80 81
 		}];
81 82
 	}