diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 604113d2d1a..9e6e4b81d07 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1568,11 +1568,16 @@ var SnippetsMenu = Widget.extend({ _activateInsertionZones: function ($selectorSiblings, $selectorChildren) { var self = this; - // If a modal is open, the drop zones must be created only in this modal - const $openModal = self.getEditableArea().find('.modal:visible'); - if ($openModal.length) { - $selectorSiblings = $openModal.find($selectorSiblings); - $selectorChildren = $openModal.find($selectorChildren); + // If a modal or a dropdown is open, the drop zones must be created + // only in this element. + const $editableArea = self.getEditableArea(); + let $open = $editableArea.find('.modal:visible'); + if (!$open.length) { + $open = $editableArea.find('.dropdown-menu.show').addBack('.dropdown-menu.show').parent(); + } + if ($open.length) { + $selectorSiblings = $open.find($selectorSiblings); + $selectorChildren = $open.find($selectorChildren); } // Check if the drop zone should be horizontal or vertical