From e984e23b49036113b09a232d08507e8e5fd338e9 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 18 Apr 2024 14:35:38 +0200 Subject: [PATCH] prevent to much ui updating --- .../user/user/collection/user-collection-header.element.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/user-collection-header.element.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/user-collection-header.element.ts index 44dac6b85e..375bbd302d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/user-collection-header.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/user-collection-header.element.ts @@ -49,9 +49,12 @@ export class UmbUserCollectionHeaderElement extends UmbLitElement { this.observe( observeMultiple([this.#collectionContext.orderByOptions, this.#collectionContext.activeOrderByOption]), ([options, activeOption]) => { - this._orderByOptions = options; + // the options are hardcoded in the context, so we can just compare the length + if (this._orderByOptions.length !== options.length) { + this._orderByOptions = options; + } - if (activeOption) { + if (activeOption && activeOption !== this._activeOrderByOption?.unique) { this._activeOrderByOption = this._orderByOptions.find((option) => option.unique === activeOption); } },