Please, view my js fiddle where I've illustrated the problem
Here's my js fiddle: https://jsfiddle.net/jajabya/fb93f7b0/
My goad is to get an input
tag where special words (like dates or users' names could be highlighted by wrapping in span
tags)
There must be a problem with div
, because when I use input field instead everything works fine.
My problem is that I can't make the caret appear in the right place
Every time when the state updates in onInput
onInput(event) {
this.setState({
html: event.target.innerText.toUpperCase()
});
}
the caret rolls back to the beginning