CodeMirror.fromTextArea constructor

CodeMirror.fromTextArea(
  1. TextAreaElement? textArea, {
  2. Map? options,
})

The method provides another way to initialize an editor. It takes a textarea DOM node as first argument and an optional configuration object as second. It will replace the textarea with a CodeMirror instance, and wire up the form of that textarea (if any) to make sure the editor contents are put into the textarea when the form is submitted. The text in the textarea will provide the content for the editor. A CodeMirror instance created this way has three additional methods: save, toTextArea, and getTextArea.

Implementation

CodeMirror.fromTextArea(TextAreaElement? textArea, {Map? options})
    : super(_createFromTextArea(textArea, options)) {
  _instances[jsProxy] = this;
}