I had a similar problem. I had a SAVE button inside a FORM. Clicking the SAVE button called a JavaScript routine which produced a modal that appeared and immediately disappeared before clicking any buttons. Moving the SAVE button outside the <form> </form>
fixed the issue. Apparently the form was interfering with the modal processing.