Closed jpw547-zz closed 4 years ago
I don't understand why you would need nested instances of editor.js. It makes no sense.
In one of my custom block, I have this function defined :
focusEditor(editor) {
editor.focus(true);
}
then I registered a click event on the wrapper :
this.api.listeners.on(Wrapper, 'click', () => {
this.focusEditor(nestedEditor);
}, false);
This might give you an idea. It's quite hackish but "it works". Still trying to figure how to avoid loosing the focus when clicking on an input.
I have an instance of EditorJS working for an Angular project that I am working on and am making several custom blocks for the editor. However one of the kinds of custom blocks that I am looking to make would have one or more discrete new instances of the block editor inside of that block.
Below is what I have for my render function in the custom block, and it correctly shows another block within the first one. However when I try to click on the nested block the focus is immediately directed to the new block that the parent editor made below my custom block. I feel like this is easier than I am probably making it, so I just thought I'd ask for any suggestions on what I might be doing wrong, or how to implement this if anyone knows how? Or maybe it isn't possible and I just didn't know.
Anyway, thanks in advance for any advice that anyone has.