Skip to content
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

Can't pass React component as placeholder anymore #2977

Closed
czechdave opened this issue Aug 21, 2019 · 3 comments
Closed

Can't pass React component as placeholder anymore #2977

czechdave opened this issue Aug 21, 2019 · 3 comments

Comments

@czechdave
Copy link
Contributor

czechdave commented Aug 21, 2019

Do you want to request a feature or report a bug?

BUG

What's the current behavior?

placeholder prop on <Editor /> can't be a React component anymore. If it's not a string the editor crashes.

What's the expected behavior?

The <Editor /> just renders placeholder if it's a React component.

https://github.com/ianstormtaylor/slate/blob/master/packages/slate-react-placeholder/src/index.js#L22

@kilrain
Copy link

kilrain commented Aug 21, 2019

I brought this up in the slack channel recently: https://slate-js.slack.com/archives/C1RH7AXSS/p1564944468254200

@gracicot
Copy link
Contributor

gracicot commented Sep 9, 2019

To workaround this issue we decided to re-implement the placeholder plugin. We needed the ability to render a react element because our placeholder was allowing text wrapping (we have a whole welcome message in it).

To allow the text wrapping we used absolute positionning and a relative element, which both have different styling properties. Doing that without react elements is not possible as far as I know.

@ianstormtaylor ianstormtaylor mentioned this issue Nov 6, 2019
@ianstormtaylor
Copy link
Owner

Fixed by #3093.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants