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

Default value in RichTextEditor #2884

Open
phuoymakara opened this issue Jun 10, 2024 · 1 comment
Open

Default value in RichTextEditor #2884

phuoymakara opened this issue Jun 10, 2024 · 1 comment
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@phuoymakara
Copy link

Describe the bug
Hello all, I need help
I can not set the default value in RichTextEditor in the React Component.

To Reproduce
Steps to reproduce the behavior:
<RichTextEditor
name="content"
readOnly={false}
defaultValue={<p>hello</p>}
/>

@michaelbromley
Copy link
Member

I managed to implement support for defaultValue, but there is still a bug whereby after the first keypress in the editor, the component seems to un-mount and re-mount again, resetting the content to empty.

Due to my lack of in-depth understanding of React, I'm finding this hard to solve. For some reason, the useEffect clean-up is being called after the first key press.

@AleksanderBondar maybe you have time to take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants