Skip to content

Commit 8725950

Browse files
authored
Merge pull request #2282 from umbraco/v14/bugfix/can-not-login-after-remove-ui-culture
Bugfix: Fix bug user can not login after remove ui culture of user
2 parents b9c62a6 + f207cfa commit 8725950

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/packages/core/localization/components/ui-culture-input/ui-culture-input.element.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
22
import { css, html, customElement, query, state, property } from '@umbraco-cms/backoffice/external/lit';
3-
import type { UUIComboboxElement, UUIComboboxEvent } from '@umbraco-cms/backoffice/external/uui';
3+
import type { UUISelectEvent } from '@umbraco-cms/backoffice/external/uui';
44
import { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui';
55
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
66
import type { ManifestLocalization } from '@umbraco-cms/backoffice/extension-registry';
@@ -59,24 +59,22 @@ export class UmbUiCultureInputElement extends UUIFormControlMixin(UmbLitElement,
5959
return this._selectElement;
6060
}
6161

62-
#onChange(event: UUIComboboxEvent) {
63-
event.stopPropagation();
64-
const target = event.target as UUIComboboxElement;
65-
66-
if (typeof target?.value === 'string') {
67-
this.value = target.value;
68-
this.dispatchEvent(new UmbChangeEvent());
69-
}
62+
#onCustomValidationChange(event: UUISelectEvent) {
63+
this.value = event.target.value.toString();
64+
this.dispatchEvent(new UmbChangeEvent());
7065
}
7166

7267
override render() {
73-
return html` <uui-combobox value="${this.value}" @change=${this.#onChange}>
74-
<uui-combobox-list>
75-
${this._options.map(
76-
(option) => html`<uui-combobox-list-option value="${option.value}">${option.name}</uui-combobox-list-option>`,
77-
)}
78-
</uui-combobox-list>
79-
</uui-combobox>`;
68+
return html`
69+
<uui-select
70+
style="margin-top: var(--uui-size-space-1)"
71+
@change=${this.#onCustomValidationChange}
72+
.options=${this._options.map(e => ({
73+
name: e.name,
74+
value: e.value,
75+
selected: e.value == this.value
76+
}))}></uui-select>
77+
`;
8078
}
8179

8280
static override styles = [

0 commit comments

Comments
 (0)