i want to save the data all the times but there is no method ,also not have the blur event 。has any ways to get it?
What do you mean "all the times"?
The blur event is implemented and waiting for the code review
What do you mean "all the times"?
just like i edit a block it can immediately save this data
The
blurevent is implemented and waiting for the code review
how i can listening the keydown and keyup events in edtor.js
You can use the onChange callback where simply call the .save()
Answered
@neSpecc Could you give me an example of implementation with "onchange", since I can't find the way to use .save (), it gives me an error when I try it
@ShadowMyst See an example from our landing page
thanks you. based on the link you passed me I did this.
const editor = new EditorJS({
holder: 'editorjs',
autofocus: true,
tools:{
header:{
class: Header,
config:{
placeholder: "Escriba el titulo",
levels: [2,3,4,5,6],
defaultLevel:2
},
inlineToolbar: true
},
list: {
class: List,
inlineToolbar:true,
}
},
data:{},
onReady: ()=>{
},
onChange:() =>{
saved();
}
});
function saved(){
editor.save().then((savedData) =>{
console.log('salvado',savedData);
}).catch((error) =>{
console.log("fallo al guardar",error)
})
}
Most helpful comment
You can use the
onChangecallback where simply call the.save()