codex-team/editor.js

[Bug] Switching to readonly mode with an empty editor

Ouverte

#1 702 ouverte le 1 juin 2021

 (2 commentaires) (2 réactions) (1 personne assignée)TypeScript (1 985 forks)batch import
buggood first issue

Métriques du dépôt

Stars
 (26 602 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur