diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index 6e2aee9e..dbd13363 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -22,7 +22,8 @@ const { let { draft, isEmpty } = $(useDraft(draftKey, initial)) let isSending = $ref(false) -let isExpanded = $ref(!isEmpty || _expanded) +let isExpanded = $ref(false) +const shouldExpanded = $computed(() => _expanded || isExpanded || !isEmpty) const { editor } = useTiptap({ content: computed({ @@ -30,7 +31,7 @@ const { editor } = useTiptap({ set: newVal => draft.params.status = newVal, }), placeholder: draft.placeholder, - autofocus: isExpanded, + autofocus: shouldExpanded, onSubmit: publish, onFocus() { isExpanded = true }, onPaste: handlePaste, @@ -177,9 +178,9 @@ const { isOverDropZone } = useDropZone(dropZoneRef, onDrop) -
+
{{ characterLimit - editor?.storage.characterCount.characters() }}
@@ -198,7 +199,7 @@ const { isOverDropZone } = useDropZone(dropZoneRef, onDrop)