From 1f3c39a38162b41830de450ef12c47a63cc40a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Thu, 19 Dec 2024 19:53:17 +0100 Subject: [PATCH 1/2] fix selection data --- .../app-language-select.element.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/language/app-language-select/app-language-select.element.ts b/src/Umbraco.Web.UI.Client/src/packages/language/app-language-select/app-language-select.element.ts index 87e02b6087a3..c4144bca3bfc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/language/app-language-select/app-language-select.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/language/app-language-select/app-language-select.element.ts @@ -112,16 +112,9 @@ export class UmbAppLanguageSelectElement extends UmbLitElement { } } - #onLabelClick(event: UUIMenuItemEvent) { - const menuItem = event.target; - const unique = menuItem.dataset.unique; - if (!unique) throw new Error('Missing unique on menu item'); - + #chooseLanguage(unique: string) { this.#appLanguageContext?.setLanguage(unique); this._isOpen = false; - - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore this._popoverElement?.hidePopover(); } @@ -153,7 +146,7 @@ export class UmbAppLanguageSelectElement extends UmbLitElement { label=${ifDefined(language.name)} data-mark="${language.entityType}:${language.unique}" ?active=${language.unique === this._appLanguage?.unique} - @click-label=${this.#onLabelClick}> + @click-label=${() => this.#chooseLanguage(language.unique)}> ${this.#isLanguageReadOnly(language.unique) ? this.#renderReadOnlyTag(language.unique) : nothing} `, From bda833e2a187c82c234764081bb2ad840a057ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Thu, 19 Dec 2024 19:57:41 +0100 Subject: [PATCH 2/2] remove unused import --- .../language/app-language-select/app-language-select.element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/language/app-language-select/app-language-select.element.ts b/src/Umbraco.Web.UI.Client/src/packages/language/app-language-select/app-language-select.element.ts index c4144bca3bfc..6b6c217dce53 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/language/app-language-select/app-language-select.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/language/app-language-select/app-language-select.element.ts @@ -2,7 +2,7 @@ import { UmbLanguageCollectionRepository } from '../collection/index.js'; import type { UmbLanguageDetailModel } from '../types.js'; import type { UmbAppLanguageContext } from '../global-contexts/index.js'; import { UMB_APP_LANGUAGE_CONTEXT } from '../constants.js'; -import type { UUIMenuItemEvent, UUIPopoverContainerElement } from '@umbraco-cms/backoffice/external/uui'; +import type { UUIPopoverContainerElement } from '@umbraco-cms/backoffice/external/uui'; import { css, html,