[WIKI-829] fix: add option to only show placeholder on empty editor (#8232)

* feat: add placeholderOnEmpty functionality to editor components

* Update packages/editor/src/core/extensions/placeholder.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: rename placeholderOnEmpty to showPlaceholderOnEmpty across editor components

* chore : make optional

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Vipin Chaudhary 2025-12-09 21:13:20 +05:30 committed by GitHub
parent 2f45bfb7f6
commit 69b64680d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 23 additions and 2 deletions

View file

@ -72,6 +72,7 @@ export const LiteTextEditor = React.forwardRef(function LiteTextEditor(
placeholder = t("issue.comments.placeholder"),
disabledExtensions: additionalDisabledExtensions = [],
editorClassName = "",
showPlaceholderOnEmpty = true,
...rest
} = props;
// states
@ -154,6 +155,7 @@ export const LiteTextEditor = React.forwardRef(function LiteTextEditor(
}),
}}
placeholder={placeholder}
showPlaceholderOnEmpty={showPlaceholderOnEmpty}
containerClassName={cn(containerClassName, "relative", {
"p-2": !editable,
})}