Modal loses focus when closing another modal

Asked

Viewed 84 times

0

Good morning, guys. I have a situation here that I can’t seem to resolve. is as follows: I have a Botstrap 4 Modal window. From this Modal window I press a button and open a second Modal Search Window (Modal on Modal).

When I close the second Modal window, the first Modal window totally loses the Focus, I cannot press anything that is in this Modal. I tried using the following codes, but it didn’t work.

$(document).ready(function(){
    $('#SegundaJanelaModal').on('hidden.bs.modal', function () {
       $('#PrimeiraJanelaModal').focus();
    })
    });


$(document).ready(function(){
    $('#SegundaJanelaModal').on('hidden.bs.modal', function () {
       $('#PrimeiraJanelaModal').hide();
       $('#PrimeiraJanelaModal').show();
    })
    });
  • Here’s an example of my situation: https://jsfiddle.net/o67s3bLn/

1 answer

0

Solution I found

#modal_1 {

    overflow-y:scroll;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.