diff --git a/packages/text-editor/src/components/StyledTextArea.svelte b/packages/text-editor/src/components/StyledTextArea.svelte index 832841542a..d28ca7ef23 100644 --- a/packages/text-editor/src/components/StyledTextArea.svelte +++ b/packages/text-editor/src/components/StyledTextArea.svelte @@ -29,6 +29,12 @@ export function submit (): void { textEditor.submit() } + export function isEditable (): boolean { + return textEditor.isEditable() + } + export function setEditable (editable: boolean): void { + textEditor.setEditable(editable) + } const dispatch = createEventDispatcher() let focused = false diff --git a/packages/text-editor/src/components/StyledTextBox.svelte b/packages/text-editor/src/components/StyledTextBox.svelte index 238bc6f0ea..22a8652490 100644 --- a/packages/text-editor/src/components/StyledTextBox.svelte +++ b/packages/text-editor/src/components/StyledTextBox.svelte @@ -69,6 +69,18 @@ export function submit (): void { textEditor.submit() } + export function focus (): void { + textEditor.focus() + } + export function isEditable (): boolean { + return textEditor.isEditable() + } + export function setEditable (editable: boolean): void { + textEditor.setEditable(editable) + } + export function setContent (data: string): void { + textEditor.setContent(data) + } const dispatch = createEventDispatcher() let focused = false @@ -124,7 +136,7 @@ if (alwaysEdit) { content = evt.detail } - dispatch('changeContent') + dispatch('changeContent', evt.detail) }} > {#if !alwaysEdit && !hideExtraButtons} diff --git a/packages/text-editor/src/components/StyledTextEditor.svelte b/packages/text-editor/src/components/StyledTextEditor.svelte index b1070b94c7..d7b50a11df 100644 --- a/packages/text-editor/src/components/StyledTextEditor.svelte +++ b/packages/text-editor/src/components/StyledTextEditor.svelte @@ -76,6 +76,18 @@ export function focus (): void { textEditor.focus() } + export function isEditable (): boolean { + return textEditor.isEditable() + } + export function setEditable (editable: boolean): void { + textEditor.setEditable(editable) + } + export function getContent (): string { + return content + } + export function setContent (data: string): void { + textEditor.setContent(data) + } $: varsStyle = maxHeight === 'card' @@ -344,7 +356,8 @@ } -