codex-team/editor.js

[Bug] Switching to readonly mode with an empty editor

Open

#1.702 geöffnet am 1. Juni 2021

Auf GitHub ansehen
 (2 Kommentare) (2 Reaktionen) (1 zugewiesene Person)TypeScript (1.985 Forks)batch import
buggood first issue

Repository-Metriken

Stars
 (26.602 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide