codex-team/editor.js

[Bug] Switching to readonly mode with an empty editor

Open

#1,702 创建于 2021年6月1日

在 GitHub 查看
 (2 评论) (2 反应) (1 负责人)TypeScript (26,602 star) (1,985 fork)batch import
buggood first issue

描述

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

贡献者指南