codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.69k stars 2.08k forks source link

Need some API #743

Closed CITGuru closed 5 years ago

CITGuru commented 5 years ago

Hello,

I am currently using this in a react blog as our writing tool and there are some methods I can't find thats suppose to be there.

Is there a method like onChange or change that tells us whenever a change occurs. I looked through the source code and I saw it there. But I think its not in use and not documented.

I also notice that the toolbar plus button is not at the right place. Like as it is in the demo on editorjs.io

gohabereg commented 5 years ago

Hi @CITGuru

There are an option for initial configuration that you can pass to handle changes https://editorjs.io/configuration#editor-modifications-callback

Plus button appears at the other place (inside of the editor zone) in the narrow wrappers, making the wrapper wider might solve the problem.

CITGuru commented 5 years ago

@gohabereg Thanks for your response.

I tried increasing the wrapper width and the plus button still the same.

in the onChange method, can we get the data apart from using the .save method

gohabereg commented 5 years ago

@CITGuru

Could you please provide a screenshot with the button?

You need to call save method manually, we don't provide saved data to the onChange callback for performance purposes

CITGuru commented 5 years ago

Screenshot from 2019-04-25 16-01-55

CITGuru commented 5 years ago

I also notice that pressing the backspace button clears the content of a block

gohabereg commented 5 years ago

Well, could you open new issue for the button bug and provide there your environment (os, browser etc). I'm closing this one