editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Update method no updating the block

Open imransilvake opened this issue 3 years ago • 0 comments

I am unable to update the Block via the update method.

method

update(id?: string, data?: BlockToolData): void

Example: I tried:

const blockToUpdate = {
	type: 'paragraph',
	data: {
	      text: 'Update Block'
	}
};

const blockIndex = editor.blocks.getCurrentBlockIndex();
editor.blocks.update(blockIndex.toString(), blockToUpdate.data);

is blockIndex the right id I am passing to the update method?

imransilvake avatar Sep 06 '22 07:09 imransilvake