bootbox icon indicating copy to clipboard operation
bootbox copied to clipboard

Issue with bootstrap-modal-bs3patch.css library and Bootbox

Open rogertcd opened this issue 12 years ago • 15 comments

I have been trying work with Bootbox and modals at the same time, but when I load "bootstrap-modal-bs3patch.css" library in the same file the Bootbox dialog appears weird, see the next screen issue

Could you please help me with it?

rogertcd avatar Dec 12 '13 20:12 rogertcd

Sorry, but I suspect using two libraries which augment Bootstrap's basic modals is always going to result in a conflict of some sort. In this case, the external CSS from another third party library (https://github.com/jschr/bootstrap-modal) is causing otherwise standard modals to appear incorrectly - I'd suggest raising a ticket on that project if needs be :).

makeusabrew avatar Dec 13 '13 14:12 makeusabrew

I fixed this conflict by adding this line after the .modal in the bootstrap-modal-bs3patch.css.

.modal.bootbox {
    border: none;
    background: none;
    box-shadow: none;
}

menacestudio avatar Oct 14 '14 22:10 menacestudio

menacestudio's solution didn't work for me, so instead I came up with this (very hacky) fix:

I renamed .modal to .modal-fix in bootstrap-modal-bs3patch.css, then added this to the init method in modal.js:

if (!this.$element.hasClass('bootbox')) {
    this.$element.addClass('modal-fix');
}

Modals and Bootbox are now working beautifully together :)

markormesher avatar Jan 29 '15 12:01 markormesher

@markormesher your hack worked.

But i also needed to adjust the backdrop z-index

baseIndex['backdrop'] = baseIndex['backdrop'] - 1;

ThaDafinser avatar May 27 '15 07:05 ThaDafinser

@markormesher Thank you very much...

AnasSafi avatar Jun 30 '15 03:06 AnasSafi

Worked like a charm - thank you @markormesher and @ThaDafinser both. Just an addition for those who may be wanting to know where to add @ThaDafinser's change - it has to be added inside bootstrap-modalmanager.js, in the getzIndex function.

dipan66 avatar Aug 28 '15 00:08 dipan66

I just had to use @menacestudio solution with one additional css

.modal.bootbox .modal-dialog
{
    width:auto;
}

because otherwise it will conflict with bootstrap rules for max width of modals.

RokSiEu avatar Jan 05 '16 21:01 RokSiEu

@makeusabrew it worked perfectly! Thank you!!!

cunhanohaole avatar May 11 '16 09:05 cunhanohaole

@markormesher Thanks!

xiao-ai avatar May 16 '16 07:05 xiao-ai

Thanks you all!

hlwz5735 avatar Jun 11 '16 09:06 hlwz5735

@markormesher Thanks!

sinceq avatar Dec 19 '16 08:12 sinceq

Thanks @menacestudio & @RokSiEu :+1:

palashmon avatar Jan 09 '17 10:01 palashmon

Thank you very much! Your solution works beautiful! @markormesher

topgun009 avatar Apr 06 '17 14:04 topgun009

Not Working

gajendra7590 avatar May 07 '20 10:05 gajendra7590

Bootbox doesn't have it's own stylesheet. If loading another library causes issues with Bootbox modals, you need to take that up with that library.

Locking this.

tiesont avatar May 07 '20 19:05 tiesont