codex-team / codex-team/editor.js

Cannot read property 'classList' of undefined

Open
#942 0 comments 7 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

```
class SomeTool {
static get isInline() {
return true;
}

constructor({ api }) {
this.button = null;
}

render() {
this.button = document.createElement("button");
this.button.type = "button";
this.button.value = "Submit";
return this.button;
}

checkState() {}

surround() {}
}

const editor = new EditorJS({
autofocus: true,
placeholder: "Let`s rite an awesome story!",
tools: {
Marker: {
class: SomeTool,
shortcut: "CMD+SHIFT+M"
}
}
});
```

Running this I'm getting following error in console

```
editor.js:22 Uncaught TypeError: Cannot read property 'classList' of undefined
at t.value (editor.js:22)
at t.value (editor.js:22)
at t.value (editor.js:12)
at t.value (editor.js:12)
at e.value (editor.js:22)
at e.value (editor.js:22)
at eval (editor.js:12)
at eval (editor.js:12)
```

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.