From 0a79f4dc28bd98da5b42bfc0bda51fb6ba6bd802 Mon Sep 17 00:00:00 2001 From: Piotrek Tomczewski Date: Fri, 6 Jan 2023 22:38:01 +0100 Subject: [PATCH] feat(publish): add hashtag autocomplete (#837) --- components/publish/PublishWidget.vue | 7 ++++--- composables/tiptap.ts | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index 00485874..1c9a937e 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -56,6 +56,7 @@ const { editor } = useTiptap({ onPaste: handlePaste, }) +const characterCount = $computed(() => htmlToText(editor.value?.getHTML() || '').length) let isUploading = $ref(false) let isExceedingAttachmentLimit = $ref(false) let failed = $ref([]) @@ -312,8 +313,8 @@ defineExpose({
-
- {{ editor?.storage.characterCount.characters() }}/{{ characterLimit }} +
+ {{ characterCount ?? 0 }}/{{ characterLimit }}
@@ -347,7 +348,7 @@ defineExpose({