Auto Save #1450
-
I'm moving over from Slate and am trying to figure out how to make it auto save to my db when a user clicks out of it. With Slate I would use an onBlur event. I tried adding the onBlur event to but nothing happens.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I came here looking for solution to the same problem. The thing is that Plate doesn't have the same onFocus and onBlur events as Slate has. I found out that there is a hook to use: Note that you don't need to call the hook from inside the |
Beta Was this translation helpful? Give feedback.
I came here looking for solution to the same problem. The thing is that Plate doesn't have the same onFocus and onBlur events as Slate has.
I found out that there is a hook to use:
useEventEditorSelectors.focus();
will give you theid
of the last focused editor. Similar forblur()
. Hope this helps you.Note that you don't need to call the hook from inside the
<Plate>
editor, you can call it anywhere, it hooks into their globalzustand
store I guess.