jqueryui modal popup box not stacking in front of other modals

jqueryui modal popup box not stacking in front of other modals

I'm having problem getting jqueryui dialog boxes to open in front of other dialog boxes that are already opened.

I recently upgraded our site to use jquery version v3.4.1and jqueryui version 1.12.1.  Prior to this upgrade it was working fine, but now it is not.

I use popup modals to display other html elements....then I also have links in that popup that open another popup box.  Now if I click on a link inside a modal popup, the other one opens, but its hidden behind the modal popup that I just clicked on.

This is how I initialize the dialog box:

$("#modal_popup_detail").dialog({
           
                bgiframe: true,
                autoOpen: false,
                stack: true, //Puts in front of other dialog's that may be open
                height:h_full_dialog,
                width: w_full_dialog,
                minWidth: w_full_dialog,
                modal: true,
                dialogClass: 'jqueryui_dialog_bg',
                open: function(e) {
                    $(e.target).prev(".ui-dialog-titlebar").addClass("jqueryui_dialog_title_bar");
                    $(e.target).prev(".ui-dialog-titlebar").find("span").addClass("jqueryui_dialog_title"); 
                 
                },
                close: function () {$(this).empty();}
            });



and this is how I call the dialog box:

$("#modal_popup_detail").dialog("open");

Any ideas how to fix this?

Thanks in advance