Is there any way to have a controlled input contentEditable div?
I am looking for this exact behavior, but I need to use a contentEditable div instead of an input:
<input value={this.state.text}></input>
where the input doesn't show what is typed, but rather what is in this.state.text
.
Just swapping out with a contentEditable div doesn't work, and it shows what is typed rather than what is in this.state.text
:
<div contentEditable={true} value={this.state.text}></div>
Stackblitz: https://stackblitz.com/edit/react-q4xoya