For the time being I have solved it on the app side with this:
jQuery(document).ajaxcom("[data-ajaxcom]", {
complete: function() {
// due to a bug in ajaxcom that does not remove a closed modal window from the page
$(".modal").not(":visible").remove();
}
});
For the time being I have solved it on the app side with this: