diff --git a/addons/web/static/src/less/bootstrap_overridden.less b/addons/web/static/src/less/bootstrap_overridden.less index 0582ec8c384..ada94dbf4ca 100644 --- a/addons/web/static/src/less/bootstrap_overridden.less +++ b/addons/web/static/src/less/bootstrap_overridden.less @@ -72,6 +72,19 @@ @modal-inner-padding: @odoo-horizontal-padding; @modal-title-padding: @odoo-horizontal-padding; +// Change the z-index of the modal-backdrop elements to be equal to the +// modal elements' ones. Bootstrap does not support multi-modals, and without +// this rule all the modal-backdrops are below all the opened modals. +// Indeed, bootstrap forces them to a lower z-index as the modal-backdrop +// element (unique in their supported cases) might be put after the modal +// element (if the modal is already in the DOM, hidden, then opened). This +// cannot happen in odoo though as modals are not hidden but removed from +// the DOM and are always put at the end of the body when opened. +// +// Note that the variable @zindex-modal-background may be renamed/removed in +// newer versions of bootstrap. +@zindex-modal-background: @zindex-modal; + //== Navs @nav-link-padding: 10px 15px; @nav-pills-border-radius: 0; diff --git a/addons/web/static/src/less/modal.less b/addons/web/static/src/less/modal.less index 95a14420773..ec96d06b67e 100644 --- a/addons/web/static/src/less/modal.less +++ b/addons/web/static/src/less/modal.less @@ -77,21 +77,8 @@ } } -// Change the z-index of the modal-backdrop elements to be equal to the -// modal elements' ones. Bootstrap does not support multi-modals, and without -// this rule all the modal-backdrops are below all the opened modals. -// Indeed, bootstrap forces them to a lower z-index as the modal-backdrop -// element (unique in their supported cases) might be put after the modal -// element (if the modal is already in the DOM, hidden, then opened). This -// cannot happen in odoo though as modals are not hidden but removed from -// the DOM and are always put at the end of the body when opened. -// -// Note that the variable @zindex-modal-background may be renamed/removed in -// newer versions of bootstrap. -@zindex-modal-background: @zindex-modal; - // Temporary fix for modals which are not instantiated thanks to the Dialog -// JS classes (deprecated case) + Frontend. +// JS classes (deprecated case) (see bootstrap_overridden.less) + Frontend. :not(body) > .modal { z-index: @zindex-modal-background + 1; }