How can I clear the value to an empty/default state by a button click? #5613
Unanswered
lazycipher
asked this question in
Q&A
Replies: 3 comments 4 replies
-
Can anyone help please? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm having the same problem: when resetting the Form (I use React Final Form) the Lexical Editor doesn't reset. I know why that happens: it's because the initialConfig is read only on mount once, and the Lexical Editor doesn't remount when the Form is resetted. So the question is: how do we force Lexical to re-read the InitialState value on a specific condition? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Try this
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a form which has a few fields and one of them is a lexical rich text field.
There's a button which is supposed to clear the things whatever user wrote and reset it to default initial value.
Is there any way to do it?
Below is my Editor component, I am supplying the value and onChange as props. I
This is my formik state:
I am already doing resetForm of formik which is resetting everything to initial state. Every other field works as expected but the Editor is the only thing not working.
Beta Was this translation helpful? Give feedback.
All reactions