[Webkit-unassigned] [Bug 157431] New: WKActionSheet tries to present on wrong view controller

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 6 14:14:29 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=157431

            Bug ID: 157431
           Summary: WKActionSheet tries to present on wrong view
                    controller
    Classification: Unclassified
           Product: WebKit
           Version: Safari 9
          Hardware: iOS
                OS: iOS 9.3
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit2
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: kevin at sb.org

When WKActionSheet is presented, it uses `[[_sheetDelegate hostViewForSheet].window rootViewController]` as the view controller to present from. But this doesn't work if the webview is actually inside a modally-presented view controller. This results in the sheet never showing and the following logged to the console:

Warning: Attempt to present <WKActionSheet: 0x7fbdac077a00> on <RootViewController: 0x7fbda8d7b340> whose view is not in the window hierarchy!

I imagine there's also issues with the rotation behavior, since it looks like it's supposed to dismiss itself and re-present after rotation.

The correct fix is to replace -hostViewForSheet with a method that returns the host UIViewController instead, but if that's problematic a quick fix would be to walk the presentedViewController chain to find the leaf controller and present on that (but this approach will have issues with view controllers that aren't fullscreen).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160506/af46831e/attachment.html>


More information about the webkit-unassigned mailing list