https://discuss.codemirror.net/t/cursor-focus-bug/2160
The error in the above link solved the problem by sending the absolute value of the cursor position to the server and getting the absolute value of the cursor position from the server when setting the value.
But the cursor moves to the front of the text area and then back to that position.
Therefore, if you keep typing, the input will not be smooth.
I need your help desperately.please…