codex-team / codex-team/editor.js

[Bug] Switching to readonly mode with an empty editor

Open
#1,702 2 comments 2 reactions 1 assignee Claimed by @slaveeks View on GitHub
bug good first issue
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.