From 1b5a46a56b0800101505149dc3b47c5df284b080 Mon Sep 17 00:00:00 2001 From: Illia Kovalenko <23364749+illiakovalenko@users.noreply.github.com> Date: Wed, 16 Mar 2022 14:39:18 +0200 Subject: [PATCH] [VUE] Experience Editor controls does not work until hard reload is done (#951) --- .../sitecore-jss-vue/src/components/PlaceholderCommon.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts b/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts index 64327fc8b9..564562a422 100644 --- a/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts +++ b/packages/sitecore-jss-vue/src/components/PlaceholderCommon.ts @@ -6,7 +6,7 @@ import { Item, RouteData, } from '@sitecore-jss/sitecore-jss/layout'; -import { HorizonEditor, resetEditorChromes } from '@sitecore-jss/sitecore-jss/utils'; +import { resetEditorChromes } from '@sitecore-jss/sitecore-jss/utils'; import { Component, h, VNode, DefineComponent, ref, onMounted } from 'vue'; import { MissingComponent } from './MissingComponent'; import { HiddenRendering, HIDDEN_RENDERING_NAME } from './HiddenRendering'; @@ -218,9 +218,10 @@ function createRawElement(elem: any) { ) { elRef.value.setAttribute('key', elem.attributes.key); - if (elRef && HorizonEditor.isActive()) { - resetEditorChromes(); - } + // Reset chromes since sometimes experience editor script is executed earlier + // than Vue script and EE can't set required attributes and chromes aren't visible + // Also required for Horizon + resetEditorChromes(); } });