Skip to content

Commit 28c01d2

Browse files
Dictionary: Fix shortcut Ctrl + S not saving dictionary items (#20605)
* switched event listener from 'change' to 'input' * Update workspace-view-dictionary-editor.element.ts
1 parent 2248eeb commit 28c01d2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Umbraco.Web.UI.Client/src/packages/dictionary/workspace/views/workspace-view-dictionary-editor.element.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { UMB_DICTIONARY_WORKSPACE_CONTEXT } from '../dictionary-workspace.context-token.js';
22
import type { UmbDictionaryDetailModel } from '../../types.js';
33
import type { UUITextareaElement } from '@umbraco-cms/backoffice/external/uui';
4-
import { UUITextareaEvent } from '@umbraco-cms/backoffice/external/uui';
54
import { css, html, customElement, state, repeat } from '@umbraco-cms/backoffice/external/lit';
65
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
76
import { UmbLanguageCollectionRepository, type UmbLanguageDetailModel } from '@umbraco-cms/backoffice/language';
@@ -72,13 +71,11 @@ export class UmbWorkspaceViewDictionaryEditorElement extends UmbLitElement {
7271
}
7372

7473
#onTextareaChange(e: Event) {
75-
if (e instanceof UUITextareaEvent) {
76-
const target = e.composedPath()[0] as UUITextareaElement;
77-
const translation = (target.value as string).toString();
78-
const isoCode = target.getAttribute('name')!;
74+
const target = e.composedPath()[0] as UUITextareaElement;
75+
const translation = (target.value as string).toString();
76+
const isoCode = target.getAttribute('name')!;
7977

80-
this.#workspaceContext?.setPropertyValue(isoCode, translation);
81-
}
78+
this.#workspaceContext?.setPropertyValue(isoCode, translation);
8279
}
8380

8481
override render() {
@@ -104,7 +101,7 @@ export class UmbWorkspaceViewDictionaryEditorElement extends UmbLitElement {
104101
slot="editor"
105102
name=${language.unique}
106103
label="translation"
107-
@change=${this.#onTextareaChange}
104+
@input=${this.#onTextareaChange}
108105
.value=${translation?.translation ?? ''}
109106
?readonly=${this.#isReadOnly(language.unique)}></uui-textarea>
110107
</umb-property-layout>`;

0 commit comments

Comments
 (0)