-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⏸ [0.7] Customize Placeholder visibility #3379
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@zurfyx By adding another new property, we're just creating 2 breaking changes we need to fix. I'd say just make |
Revisited the whole PR based on @trueadm and @thegreatercurve's comments. Now it's a 0.7 breaking change and the placeholder makes it possible to pass a callback functio with an |
@@ -171,7 +171,7 @@ export default function Editor(): JSX.Element { | |||
contentEditable={ | |||
<ContentEditable className="TableNode__contentEditable" /> | |||
} | |||
placeholder={''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should still work, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just placeholder={null}
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings should be allowed too.
Closes #3349 |
Edit:
Revisited the whole PR based on @trueadm and @thegreatercurve's comments. Now it's a 0.7 breaking change and the placeholder makes it possible to pass a callback functio with an editable param to allow customization.
Provi @ Discord
That's a valid concern. The reason why I removed it in #3030 was to promote the use Lexical for long-content form read-only views where the placeholder wouldn't make much sense. However, it still makes sense on shorter form content, and in fact, the
<input disabled>
and<textarea disabled>
shows the placeholder when disabled, which makes me reconsider whether that was a good solution in the first place.Unfortunately, I can't just change the current behavior without causing a breaking change which would be undesirable but we can still provide the option to customize the non-editable placeholder via a new {Plain/Rich}TextPlugin property (
placeholderNonEditable
) while preserving the original behavior.That said, this is likely to change in the not so distant future. We are reconsidering how we package RichText and PlainText to provide further flexibility while making it easier for newcomers to bootstrap a rich text editor quickly.