Popup doesn't completely close when inside modal (v1.1.0)

I have a controller function like this, which opens a popup inside a modal:

if (comment.owner) {
    commentSrvc.deleteComment(comment).then(function (response) {
        // success handler
        $scope.hideLoading();
        $scope.getComments();

        $ionicPopup.alert({
            title: 'Comment Deleted',
            template: response
        });

    }, function (response) {
        // error handler
        $scope.hideLoading();

        $ionicPopup.alert({
            title: 'Error deleting comment',
            template: response
        });
    });

} else {
    return false;
}

It all works well, except that the popup doesn’t close when the OK button is clicked. The mask disappears, but the alert box itself remains, even after the state is changed or the modal closed. The button indicates clicks (it’s not inaccessible as with the earlier bug). This is the case both in the browser and on a device.

This seems like a continuation of an earlier issue: Using Popups in Modals

UPDATE: It’s worth noting that a confirmation popup prior to the service call works perfectly. It’s only this notification alert called after the service call that fails to close.

UPDATE AGAIN: It’s apparently the fact that the alert is called in the service callback that causes the issue. If I strip the service call, all works as expected.

Thanks.

1 Like

I’ve found that adding a substantial delay resolves the issue:

 $timeout(function () {
     $scope.showAlert('Comment Deleted', response);
 }, 500); // alert can't be closed unless we delay a bit