Skip to content

Commit 61bb9e6

Browse files
committed
fix: camera modal displayed under tab view
related to #128
1 parent 8268275 commit 61bb9e6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/camera.ios.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@ export let takePicture = function (options): Promise<any> {
165165
if (topMostFrame) {
166166
let viewController: UIViewController = topMostFrame.currentPage && topMostFrame.currentPage.ios;
167167
if (viewController) {
168+
while (viewController.parentViewController) {
169+
// find top-most view controler
170+
viewController = viewController.parentViewController;
171+
}
172+
173+
while (viewController.presentedViewController) {
174+
// find last presented modal
175+
viewController = viewController.presentedViewController;
176+
}
177+
168178
viewController.presentViewControllerAnimatedCompletion(imagePickerController, true, null);
169179
}
170180
}

0 commit comments

Comments
 (0)