Skip to content

Commit d6bf84d

Browse files
committed
Restore placeholder when empty
1 parent 350a10d commit d6bf84d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

web/src/components/common/MentionTextarea.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ export const MentionTextarea = forwardRef<HTMLDivElement, MentionTextareaProps>(
8888
const updateContent = useCallback((text: string) => {
8989
if (!editableRef.current) return
9090

91+
// If text is empty, clear innerHTML to show placeholder
92+
if (!text.trim()) {
93+
editableRef.current.innerHTML = ''
94+
return
95+
}
96+
9197
// Convert storage format mentions to display format
9298
const displayText = convertMentionsToDisplay(text, mentionItems)
9399

0 commit comments

Comments
 (0)