Ionaru / Ionaru/easy-markdown-editor

`toTextArea()` no longer functions in 2.11.0

Open
#217 2 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
3.1k
Forks
363
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Calling `toTextArea()` results in an exception:
```
Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
```

**To Reproduce**
Steps to reproduce the behavior:
1. Call the `toTextArea()` function on an instance of EasyMDE.

https://stackblitz.com/edit/js-r8f7lh

**Expected behavior**
Text area to be successfully restored and EasyMDE disposed.

** Version information **
- OS: all
- Browser: Edge 84
- EasyMDE version: 2.11.0

**Additional context**
Issue does not occur in 2.10.1, only started occuring in 2.11.0
Seems to be related to changing the DOM hierarchy by adding another container div which causes issues with the underlying CodeMirror `toTextArea()` function code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.