Skip to content

Commit

Permalink
Merge pull request #2282 from umbraco/v14/bugfix/can-not-login-after-…
Browse files Browse the repository at this point in the history
…remove-ui-culture

Bugfix: Fix bug user can not login after remove ui culture of user
  • Loading branch information
iOvergaard authored Sep 13, 2024
2 parents b9c62a6 + f207cfa commit 8725950
Showing 1 changed file with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
import { css, html, customElement, query, state, property } from '@umbraco-cms/backoffice/external/lit';
import type { UUIComboboxElement, UUIComboboxEvent } from '@umbraco-cms/backoffice/external/uui';
import type { UUISelectEvent } from '@umbraco-cms/backoffice/external/uui';
import { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { ManifestLocalization } from '@umbraco-cms/backoffice/extension-registry';
Expand Down Expand Up @@ -59,24 +59,22 @@ export class UmbUiCultureInputElement extends UUIFormControlMixin(UmbLitElement,
return this._selectElement;
}

#onChange(event: UUIComboboxEvent) {
event.stopPropagation();
const target = event.target as UUIComboboxElement;

if (typeof target?.value === 'string') {
this.value = target.value;
this.dispatchEvent(new UmbChangeEvent());
}
#onCustomValidationChange(event: UUISelectEvent) {
this.value = event.target.value.toString();
this.dispatchEvent(new UmbChangeEvent());
}

override render() {
return html` <uui-combobox value="${this.value}" @change=${this.#onChange}>
<uui-combobox-list>
${this._options.map(
(option) => html`<uui-combobox-list-option value="${option.value}">${option.name}</uui-combobox-list-option>`,
)}
</uui-combobox-list>
</uui-combobox>`;
return html`
<uui-select
style="margin-top: var(--uui-size-space-1)"
@change=${this.#onCustomValidationChange}
.options=${this._options.map(e => ({
name: e.name,
value: e.value,
selected: e.value == this.value
}))}></uui-select>
`;
}

static override styles = [
Expand Down

0 comments on commit 8725950

Please sign in to comment.