editor-js / editor-js/table

I got the change event when I replace the old data using the render method

Open
#132 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
146
Forks
162
Avg merge
5m
Merged PRs (30d)
1

Description

here is my code to reset data, it will replace the old data:
```javascript
const resetData = async (id:string) => {
try {
await editor.isReady;
console.log('Editor.js is ready to work!')
const data = await getNoteById(id)
if (data) {
if (data?.editorBlocks) {
const editorData = {blocks: data?.editorBlocks ,version: data?.editorVersion,time: data?.editorTime} as OutputData;
await editor.render( editorData)
} else {
// removes all Blocks and creates new empty initial type Block
editor.clear()
}
}

} catch (reason) {
console.log(`Editor.js initialization failed because of ${reason}`)
}
}
````
if the editor contain the table block, it will trigger change event when I call the resetData method. It will save the wrong data.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.