From 68d0d48199d997a7571c86d7debd881ce6718737 Mon Sep 17 00:00:00 2001 From: Michel EDIGHOFFER Date: Mon, 9 Jan 2023 10:34:26 +0100 Subject: [PATCH] fix(tiptap): update placeholder in case of language change (#896) --- composables/tiptap.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composables/tiptap.ts b/composables/tiptap.ts index 0c454bee..24219ce7 100644 --- a/composables/tiptap.ts +++ b/composables/tiptap.ts @@ -58,7 +58,7 @@ export function useTiptap(options: UseTiptapOptions) { suggestion: HashtagSuggestion, }), Placeholder.configure({ - placeholder: placeholder.value, + placeholder: () => placeholder.value!, }), CodeBlockShiki, Extension.create({ @@ -106,6 +106,9 @@ export function useTiptap(options: UseTiptapOptions) { return editor.value?.commands.setContent(value || '', false) }) + watch(placeholder, () => { + editor.value?.view.dispatch(editor.value?.state.tr) + }) return { editor,