DenisAlliswell Github contribution chart
DenisAlliswell Github Stats
DenisAlliswell Most Used Languages

Activity

24 Nov 2022

DenisAlliswell

started

Started On 09 Nov 2022 at 03:59:43

DenisAlliswell

started

Started On 04 Nov 2022 at 06:52:08
Issue Comment

DenisAlliswell

Multiple bootstrap modals scrolling issue.

The scenario is. I have my main page where i already have scrolling. Where i am opening one bootstrap dialogue which is also bigger and the scroll is showing and scrolling the dialogue. In this big dialogue i have opened one more dialogue which is smaller one which remove the scroll. after i close this small dialogue the scroll is coming back on the back but it is not scrolling the dialogue. The scroll is working for the main page.

So how to handle this situation?

Thank you in Advance.

Hrushikesh

Forked On 27 Oct 2022 at 09:27:23

DenisAlliswell

For those who are still facing this issue/limitation.

Workaround 1:

$('.modal').on('hidden.bs.modal', (e) => {
    $('body').addClass('modal-open');
}); 

If this not helping, here's workaround 2:

$('.modal').on("hidden.bs.modal", function (e) {
    if($('.modal:visible').length)
    {
        $('.modal-backdrop').first().css('z-index', parseInt($('.modal:visible').last().css('z-index')) - 10);
        $('body').addClass('modal-open');
    }
}).on("show.bs.modal", function (e) {
    if($('.modal:visible').length)
    {
        $('.modal-backdrop.in').first().css('z-index', parseInt($('.modal:visible').last().css('z-index')) + 10);
        $(this).css('z-index', parseInt($('.modal-backdrop.in').first().css('z-index')) + 10);
    }
}); 

Credits to this blog

Commented On 27 Oct 2022 at 09:27:23

DenisAlliswell

started

Started On 05 Oct 2022 at 10:44:10

DenisAlliswell

started

Started On 05 Oct 2022 at 08:55:59

DenisAlliswell

started

Started On 04 Oct 2022 at 04:22:54

DenisAlliswell

started

Started On 03 Oct 2022 at 11:11:13

DenisAlliswell

started

Started On 13 Sep 2022 at 05:11:44

DenisAlliswell

started

Started On 13 Sep 2022 at 04:53:09

DenisAlliswell

started

Started On 10 Sep 2022 at 02:23:36

DenisAlliswell

started

Started On 08 Sep 2022 at 04:57:35