jasny / bootstrap

The missing components for your favorite front-end framework.
https://www.jasny.net/bootstrap/
Apache License 2.0
2.68k stars 497 forks source link

For navmenu offcanvas push, bootstrap .modal disappears immediately #414

Open hujinhui69 opened 9 years ago

hujinhui69 commented 9 years ago

To produce:

set canvas to 'body', put .modal dialog under body, in slid-in state, if you trigger event to show the modal, it will disappear immediately after slid-in is completed.

After debugging, found messing around style is kind of not quite reliable. Because during slid-in and out, scripting can change the style of the element, and when hide() rolls back the changes, the changes made by scripting are lost. E.g., .modal is hidden before scripting bring it to screen, when 'show' is triggered, 'display: block' will be added dynamically to the .modal style. If this style is rolled back, it becomes hidden, that's exactly why .modal disappeared.

I saw there is exclude option, maybe I can exclude .modal so that .modal won't be collected although it meets position:fixed. But, in theory, if any element that happens to have position:fixed, and style is changed in slid-in state, the roll-back logic will lose all the changes.

Right now, I'm using reveal z-index approach instead, in which case canvas is limited, I only need to move all .modal under .canvas to body if modal-backdrop is in use.

It's quite possible I missed some easy settings to work around it.

A great plugin, saved me a lot of time. Thanks.

Minstel commented 8 years ago

@hujinhui69 You can simply use: .modal.in { display: block!important; }