Bootstrap Modal Freezes iFrame

Environment

Question

Upvotes: 0

Views: 271

Answers (1)

I figured it was something that had to do with focus. I had to add the following script inside my iFrame to regain focus. Adding the respective code in the parent window did not seem to fix it, but this did the trick in my iframe:

        $('#myModal', parent.document).on('hidden.bs.modal', function (e) {
        debugger;
        var iframe = $("#myIframe")[0];
        iframe.contentWindow.focus();
    });

Upvotes: 1

Related Questions