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

[Bug] Switching to readonly mode with an empty editor

Open Bezpro opened this issue 4 years ago • 2 comments

Describe a bug. If you switch the editor to read-only mode after initialization, an error appears: System.Exception: Cannot read property 'holder' of undefined

togglePreviewVisibility(visible: boolean) {
		this._editor.readOnly.toggle(visible); // this._editor.blocks.getBlocksCount() === 0
		this.previewVisible = visible;
	}

Editor.js version: 2.22.0

Bezpro avatar Jun 01 '21 13:06 Bezpro

Is there a workaround for this?

aiavci avatar Jan 02 '22 20:01 aiavci

Same as #1741

seancheung avatar Jan 28 '22 10:01 seancheung