codex-team / codex-team/editor.js

[Bug] Making editor readonly permanently removes the Block Tune toolbox

Open
#2,083 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Making editor readonly _permanently_ removes the Block Tune toolbox (even if you make it read-write later)
It also appears to cause an infinite loop of errors:
`Uncaught TypeError: this.nodes.toolbox is null`

These issues appear to be new since version 2.23.2

Steps to reproduce:
1. editor.readOnly.toggle(true);
2. Observe errors
3. editor.readOnly.toggle(false);
4. Observe block tune UI does not return.

Expected behavior:
A. No repeating errors in the console
B. Block tune UI should reappear when read-write.

Screenshots:
In Step 4, the ... and + menu is missing:
![image](https://user-images.githubusercontent.com/4155218/174107407-ae66829d-ebbd-4f24-85a4-5cbc645e2ca9.png)

In Step 2
``Uncaught TypeError: this.nodes.toolbox is null
value http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
l http://homestead.test/js/editor.js:2
setTimeout handler*o/t.throttle/< http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
on http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
t http://homestead.test/js/editor.js:2
l http://homestead.test/js/editor.js:2
_invoke http://homestead.test/js/editor.js:2
e http://homestead.test/js/editor.js:2
n http://homestead.test/js/editor.js:2
s http://homestead.test/js/editor.js:2
exports http://homestead.test/js/editor.js:2
exports http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
t http://homestead.test/js/editor.js:2
l http://homestead.test/js/editor.js:2
_invoke http://homestead.test/js/editor.js:2
e http://homestead.test/js/editor.js:2
n http://homestead.test/js/editor.js:2
s http://homestead.test/js/editor.js:2
exports http://homestead.test/js/editor.js:2
exports http://homestead.test/js/editor.js:2
value http://homestead.test/js/editor.js:2
t http://homestead.test/js/editor.js:2
l http://homestead.test/js/editor.js:2
_invoke http://homestead.test/js/editor.js:2
e http://homestead.test/js/editor.js:2
n http://homestead.test/js/editor.js:2
s http://homestead.test/js/editor.js:2
exports http://homestead.test/js/editor.js:2
exports http://homestead.test/js/editor.js:2
promise callback*t/ http://homestead.test/js/user.js:8``

Device, Browser, OS:
Desktop/Firefox/Windows 10

Editor.js version: 2.24.3

Plugins you use with their versions:
paragraph@2.8.0
header@2.6.2
simple-image@1.4.1
delimiter@1.2.0

Configuration:
```
tools: {
/**
* Each Tool is a Plugin. Pass them via 'class' option with necessary settings {@link docs/tools.md}
*/
paragraph: {
class: Paragraph,
inlineToolbar: ['bold', 'italic'],
},
header: {
class: Header,
inlineToolbar: [],
config: {
placeholder: 'Chapter',
levels: [1],
defaultLevel: 1
},
shortcut: 'CMD+SHIFT+C'
},
/**
* Or pass class directly without any configuration
*/
image: {
class: SimpleImage,
inlineToolbar: [],
},

delimiter: Delimiter,
//quote: Quote,
},
```

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.