diff --git a/src/components/TaskEditor.tsx b/src/components/TaskEditor.tsx index 980449b..dba058c 100644 --- a/src/components/TaskEditor.tsx +++ b/src/components/TaskEditor.tsx @@ -29,7 +29,13 @@ export const TaskEditor: Component = (props) => { }, }), Placeholder.configure({ - placeholder: "Type '/' for commands or start writing...", + placeholder: ({ editor }) => { + // Only show placeholder if first node is a paragraph and doc is empty/short + if (editor.state.doc.childCount > 1 || (editor.state.doc.firstChild && editor.state.doc.firstChild.type.name !== 'paragraph')) { + return ""; + } + return "Type '/' for commands or start writing..."; + }, emptyEditorClass: "is-editor-empty before:content-[attr(data-placeholder)] before:text-muted-foreground before:float-left before:pointer-events-none before:h-0", }), TaskList.configure({ @@ -65,7 +71,7 @@ export const TaskEditor: Component = (props) => { "[&_ul[data-type='taskList']]:list-none [&_ul[data-type='taskList']]:p-0", "[&_li[data-type='taskItem']]:flex [&_li[data-type='taskItem']]:items-start", "[&_li[data-type='taskItem']>label]:mr-2 [&_li[data-type='taskItem']>label]:mt-0.5 [&_li[data-type='taskItem']>label]:select-none", - "[&_li[data-type='taskItem']>div]:flex-1", + "[&_li[data-type='taskItem']>div]:flex-1 [&_li[data-type='taskItem']>div]:min-h-[1.5rem]", props.class ), },