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 7f51ee7749d..8ea0ddfb647 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -451,9 +451,9 @@ var SnippetEditor = Widget.extend({ await new Promise(resolve => { this.trigger_up('call_for_each_child_snippet', { $snippet: this.$target, - callback: function (editor, $snippet) { + callback: async function (editor, $snippet) { for (var i in editor.styles) { - editor.styles[i].onRemove(); + await editor.styles[i].onRemove(); } }, onSuccess: resolve, diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 02a911c15d0..bbe193c813e 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -2950,8 +2950,9 @@ const SnippetOptionWidget = Widget.extend({ * Called when the associated snippet is about to be removed from the DOM. * * @abstract + * @returns {Promise|undefined} */ - onRemove: function () {}, + onRemove: async function () {}, /** * Called when the target is shown, only meaningful if the target was hidden * at some point (typically used for 'invisible' snippets).