From cdc56ce13a135067672b06d9e26714dc41e383de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20M=C3=B8ller=20Jensen?= <26099018+JesmoDev@users.noreply.github.com> Date: Thu, 26 Jan 2023 00:40:36 +0100 Subject: [PATCH] tree element hack --- .../src/backoffice/shared/components/tree/tree.element.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/tree/tree.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/tree/tree.element.ts index ecb978bd32..3339b1c672 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/tree/tree.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/tree/tree.element.ts @@ -40,7 +40,12 @@ export class UmbTreeElement extends UmbLitElement { this._treeContext?.setSelectable(newVal); if (newVal) { - this._observeSelection(); + requestAnimationFrame(() => { + //TODO: This is a hack! Remove requestAnimationFrame when the element gets fixed + //TODO: For now this _observeSelection is called before the _treeContext is initialized which results in the observer not being setup + //TODO: and selections not updating + this._observeSelection(); + }); } }