diff --git a/assets/js/src/newsletter_editor/blocks/container.js b/assets/js/src/newsletter_editor/blocks/container.js index 12643d4db4..7abaf2e8aa 100644 --- a/assets/js/src/newsletter_editor/blocks/container.js +++ b/assets/js/src/newsletter_editor/blocks/container.js @@ -79,6 +79,9 @@ Module.ContainerBlockModel = base.BlockModel.extend({ Module.ContainerBlocksView = Marionette.CollectionView.extend({ className: 'mailpoet_container', + events: { + click: 'removeFocusFromAnyActiveElement', + }, childView: function (model) { return App.getBlockTypeView(model.get('type')); }, @@ -102,6 +105,15 @@ Module.ContainerBlocksView = Marionette.CollectionView.extend({ onChildviewResizeStop: function onChildviewResizeStart(event) { this.triggerMethod('resizeStop', event); }, + removeFocusFromAnyActiveElement: function removeFocusFromAnyActiveElement(event) { + if (!event || !event.target) { + return; + } + if (event.target.className.indexOf('mailpoet_container_horizontal') === -1) { + return; + } + document.activeElement.blur(); + }, }); Module.ContainerBlockView = base.BlockView.extend({