From 8a02466a18650a19053932cf187e18c5ec02c7b1 Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 22 Apr 2022 11:59:11 +0100 Subject: [PATCH 1/2] Increase reliability of blocks value being updated, they can be cleared / pasted now etc. --- admin/src/components/editorjs/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/src/components/editorjs/index.js b/admin/src/components/editorjs/index.js index a700288..2c4239a 100755 --- a/admin/src/components/editorjs/index.js +++ b/admin/src/components/editorjs/index.js @@ -50,10 +50,10 @@ const Editor = ({ onChange, name, value }) => { } document.querySelector('[data-tool="image"]').remove() }} - onChange={(api, newData) => { - if (newData.blocks.length) { - onChange({target: {name, value: JSON.stringify(newData)}}); - } + onChange={(api) => { + api.saver.save().then((res) => { + onChange({target: {name, value: JSON.stringify(res)}}); + }); }} tools={{...requiredTools, ...customTools, ...customImageTool}} instanceRef={instance => setEditorInstance(instance)} From b2784f9a088c9562e15c10c25ab0d376eb1a7631 Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 22 Apr 2022 11:59:56 +0100 Subject: [PATCH 2/2] Remove the duplicate `value` key in props for admin/src/components/Wysiwyg/index.js --- admin/src/components/Wysiwyg/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/admin/src/components/Wysiwyg/index.js b/admin/src/components/Wysiwyg/index.js index b477dbf..b6729e3 100755 --- a/admin/src/components/Wysiwyg/index.js +++ b/admin/src/components/Wysiwyg/index.js @@ -57,8 +57,7 @@ Wysiwyg.defaultProps = { disabled: false, error: undefined, intlLabel: '', - required: false, - value: '', + required: false }; Wysiwyg.propTypes = {