Closed megazoll closed 2 years ago
renderItems()
method there seems to be an infinite while loop in the else
case of the if
statement if (this.readOnly) {
const redactor = document.getElementsByClassName('codex-editor__redactor')[0];
const { children } = redactor;
const { length } = children;
for (let i = 0; i < length; i += 1) {
const blockCover = children[i].firstChild;
const blockContainer = blockCover.firstChild;
const { id } = blockContainer;
if (id === this.wrapper.id) {
toggleRoot = i;
break;
}
}
} else {
const toggle = this.wrapper.children[1];
let currentBlock = {};
while (currentBlock[1] !== toggle) {
// 🚨🚨***** INFO: this is an infinite loop ***** 🚨🚨
toggleRoot = this.api.blocks.getCurrentBlockIndex();
const block = this.api.blocks.getBlockByIndex(toggleRoot);
const { holder } = block;
const blockCover = holder.firstChild;
const blockContent = blockCover.firstChild;
currentBlock = blockContent.children;
this.api.caret.setToNextBlock('end', 0);
}
}
I also met
Thank you all for reporting the bug, we will prioritize it!
Hi there! This bug has been solved in the v0.3.1
😅
Hi there! This bug has been solved in the
v0.3.1
😅
Thank you so much 😇
Thank you so much
Precheck
Description
When adding toggle block to editor, saving data and then trying to render data back, editor js breaks down. Looks like an infinite loop somewhere in plugin.
Environment
Current behavior
https://codepen.io/megazoll/pen/VwxzMQx
Expected behavior
Editorjs should render toggle block