-
-
Notifications
You must be signed in to change notification settings - Fork 675
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
setValue has no effect #1169
Comments
My guess is ianstormtaylor/slate#4540 caused a regression here when using Slate 0.67.0 and newer. |
FYI -- you can force
|
(From ianstormtaylor/slate#3575 it seems like setting |
I'm a newbie and I've applied this code. In my situation, it keeps on re-rendering the component. So, what happens is that everytime I type, the focus is always at 0,0. Am I missing something here? |
I also had a "re-render on every keypress" problem but after memo'izing my BTW -- that code is for how to clear the editor (e.g. if you wanted to do a 'reset') so if you've applied it directly within a "set value" situation then of course it's going to re-render and set the cursor to (0,0) (since that's what it does!). |
I see, thank you for your reply. |
See the performance checklist https://slate-js.slack.com/archives/C013QHXSCG1/p1633184716321200?thread_ts=1629699684.097900&cid=C013QHXSCG1 |
Description
To clear the editor (or set to some initial value) it has been documented to use the
value
property onPlate
(e.g. via auseState
hook). I simply cannot get a recent version of Plate to respond to eithersetValue
(in the store) or via thevalue
prop.Steps
I have forked a CodeSandbox from another issue where clearing the editor worked as expected and updated it with the latest Plate dependencies: https://codesandbox.io/s/plate-onkeydown-error-forked-945d9?file=/src/App.js
(Simply follow the instructions in the browser.)
Sandbox
https://codesandbox.io/s/plate-onkeydown-error-forked-945d9?file=/src/App.js
Expectation
value
(orusePlateActions
'ssetValue()
) will cause the value of the editor to change.Environment
The text was updated successfully, but these errors were encountered: