diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js index 19c173a9d2c..0e3cf2dac48 100644 --- a/addons/web/static/src/js/core/dom.js +++ b/addons/web/static/src/js/core/dom.js @@ -495,11 +495,13 @@ var dom = { } function _adapt() { - if (!$el.is(':visible')) { + _restore(); + + if (!$el.is(':visible') || $el.closest('.show').length) { + // Never transform the menu when it is not visible yet or if + // it is a toggleable one. return; } - - _restore(); if (config.device.size_class <= config.device.SIZES[options.sizeClass]) { return; }