strapi-plugin-react-editorjs
strapi-plugin-react-editorjs copied to clipboard
Value onChange event isn't updating when you paste blocks from one editor to another
If you paste blocks from one strapi window to another and click save it doesnt reflect when you next load the content type, you can work around it by adding a few chars and removing them and then hitting save
This resolves it in our case
onChange={(api, newData) => {
if (newData.blocks.length) {
onChange({target: {name, value: JSON.stringify(newData)}});
} else {
api.saver.save().then((res) => {
onChange({target: {name, value: JSON.stringify(res)}});
});
}
}}
@kgrosvenor Oh that's amazing, could you send a PR with your changes so we can include them in the package?
I shall do this evening @melishev i brought this into our work project like mentioned but will move into this project also and create a PR
I went with this in the end since its a same result mostly
onChange={(api) => {
api.saver.save().then((res) => {
onChange({target: {name, value: JSON.stringify(res)}});
});
}}