I have a long textarea, with 100-200 lines.
They corresponds to redux state phrases = [{id, text, ...}]
, each line of textarea is a phrases[id].text.
<textarea value={_.map(phrases, 'text').join('\n')}></textarea>
When I change textarea, it dispatches change of redux state phrases
.
And when I change one letter from first line, page scrolls to end and cursor goes to 200th line. But I want that cursor and scroll position of page doesn't change.
I tried to use event.target.selectionStart, selectionEnd, but even cursor returns on its position, page scrolls to the screen end.
How to fix it?