Indranil Talukdar
Indranil Talukdar

Reputation: 21

how to create an editor using contenteditable in react and underline words dynamically(onChange)?

i'm creating an editor using react-contenteditable. I want to underline the words which are not in my database dynamically while the user is typing. What is the proper way to do it? i want to create a spell correction app.

<ContentEditable
  id="ContentEditableId"
  //onClick={elem => this.editableClick(elem)}
  className={"editableClass resultContainer"}
  html={this.state.html} // innerHTML of the editable div
  disabled={false} // use true to disable edition
  onChange={this.handleContentChange} //handle innerHTML change
  //tagName={"pre"}
  //onMouseUp={() => {rangy.getSelection().expand("word", { trim: true});}}
    />

Upvotes: 0

Views: 285

Answers (0)

Related Questions