Skip to content

Commit

Permalink
fix selection data
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslyngsoe committed Dec 19, 2024
1 parent a582732 commit 1f3c39a
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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}
</uui-menu-item>
`,
Expand Down

0 comments on commit 1f3c39a

Please sign in to comment.