codex-team/editor.js

[Bug] Switching to readonly mode with an empty editor

Aperta

#1702 aperta il 1 giu 2021

 (2 commenti) (2 reazioni) (1 assegnatario)TypeScript (1985 fork)batch import
buggood first issue

Metriche repository

Star
 (26.602 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor