WKWebView dismiss its entire view controller when presented modally

Originator:matax87
Number:rdar://34547298 Date Originated:09/20/2017
Status:Open Resolved:
Product:WebKit Product Version:iOS 11.0
Classification:Bug Reproducible:Always
 
Area:
WebKit

Summary:
On iOS 11.0, "WKWebView"s which are presented modally will dismiss their view controller when a callout is dismissed (both "UIPopoverPresentationController" and "UIAlertController").

Steps to Reproduce:
1. Create a view controller containing a "WKWebView" loading some URL
2. Present modally the view controller of the previous step
3. Tap and hold on a link in the web page to present the callout (popover or alert)
4. Dismiss the callout (popover or alert)

or you can download my sample project (https://github.com/matteomatassoni/ModalWebViewiOS11Bug), run it and then follow step 3 and 4

Expected Results:
Dismiss of callout of step 3 and 4

Actual Results:
Dismiss of presented view controller of step 2

Version/Build:
iOS 11.0

Configuration:
Any

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!