From 315f08c55dca97a7078d8ba40653f0bb4e4ee423 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 24 May 2023 10:22:31 +0200 Subject: [PATCH] Ensure that blocks always open automatically when added to block list or block grid (#14294) --- .../blockgrid/umbBlockGridPropertyEditor.component.js | 2 +- .../blocklist/umbBlockListPropertyEditor.component.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js index 9111beb250..c37b41aca3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js @@ -1011,7 +1011,7 @@ blockObject = vm.layout[createIndex].$block; } // edit block if not `hideContentInOverlay` and there is content properties. - if(blockObject.hideContentInOverlay !== true && blockObject.content.variants[0].tabs[0]?.properties.length > 0) { + if(blockObject.hideContentInOverlay !== true && blockObject.content.variants[0].tabs.find(tab => tab.properties.length > 0) !== undefined) { vm.options.createFlow = true; blockObject.edit(); vm.options.createFlow = false; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js index 49a6a26169..6c562a865b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js @@ -621,7 +621,7 @@ var blockObject = vm.layout[createIndex].$block; if (inlineEditing === true) { blockObject.activate(); - } else if (inlineEditing === false && blockObject.hideContentInOverlay !== true && blockObject.content.variants[0].tabs[0]?.properties.length > 0) { + } else if (inlineEditing === false && blockObject.hideContentInOverlay !== true && blockObject.content.variants[0].tabs.find(tab => tab.properties.length > 0) !== undefined) { vm.options.createFlow = true; blockObject.edit(); vm.options.createFlow = false;