You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug as it doesn't happen when you use the default paragraph. So I've added this here as I suspect it's my code causing the problem.
I've created a bilingual paragraph plugin as my editor has to support 2 languages. Most things seem to be working quite well (I'm fairly sure I haven't done a brilliant job of it but hey!). The only issue I have is when you press the plus ('Add') button and add a new Text block, and ONLY when you press this on the last block in the editor. This adds 2 new paragraphs when it adds 1 at all other times. If you press it on a block in the middle this works correctly and only adds one block
I have quite a lot of code... but I was wondering if anyone can spot anything obvious that might be causing this?
My editor is initiated like this
let editorData = $(`#${editor.id}`).find(".editordata").data("json");
pageEditorHolder[editor.id] = new EditorJS({
// Id of Element that should contain Editor instance
holder: editor.id,
tools: {
header: {
class: HeaderBilingual,
inlineToolbar: true
},
paragraph: {
class: TextBilingual,
inlineToolbar: true
},
image: {
class: InlineImage,
inlineToolbar: true
}
},
defaultBlock: 'paragraph',
data: editorData,
minHeight: 30,
// turn this on and off based on Auth
readOnly: false,
i18n: i18n,
onReady: () => {
editorsReady++;
if (editorsReady == pageEditors.length) {
//console.log("All editors loaded");
editorsLoaded();
}
},
onChange: (api, event) => {
_enableSavebutton();
}
});
I have a base class for my blocks with some standard methods for building a bilingual editor
I'm not sure if this is a bug as it doesn't happen when you use the default paragraph. So I've added this here as I suspect it's my code causing the problem.
I've created a bilingual paragraph plugin as my editor has to support 2 languages. Most things seem to be working quite well (I'm fairly sure I haven't done a brilliant job of it but hey!). The only issue I have is when you press the plus ('Add') button and add a new Text block, and ONLY when you press this on the last block in the editor. This adds 2 new paragraphs when it adds 1 at all other times. If you press it on a block in the middle this works correctly and only adds one block
I have quite a lot of code... but I was wondering if anyone can spot anything obvious that might be causing this?
My editor is initiated like this
I have a base class for my blocks with some standard methods for building a bilingual editor
and my default bilingual paragraph block is here
The text was updated successfully, but these errors were encountered: