Text is added at wrong caret position in text area
See original GitHub issueInitilization Code
CodeMirror.fromTextArea($(".edit-box", this.element)[0], { mode: "text/html", lineNumbers: true, lineWrapping: true });
On adding text in editor sometimes the text is added in the wrong position as shown in the GIF below This issue is tested on version 3.21.0 and 5.48.4 Steps to reproduce.
- Open the editor add text in it.
- Click on the end of any word and then click on the start of the next word.
- Type anything, it will be added to wrong position.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Text is added at wrong caret position in codemirror text area
Open the editor add text in it. · Click on the end of any word and then click on the start of the...
Read more >Position is wrong, if text ist longer than inputbox/textarea #51
Since the package is forcing white-space: pre-wrap on the input as well as textarea there is no easy way around this.
Read more >How to set and get cursor position in a text area - TinyMCE
Setting the cursor position · 1. Select content, and then bookmark the position of the content · 2. Set the caret position on...
Read more >How to insert text into the textarea at the current cursor position?
First, get the current position of cursor with the help of property named as selectionStart on textarea/inputbox. To insert the text at the ......
Read more >HOW TO: Where's the text cursor? | by Jhey Tompkins | Medium
Showing the cursor position on input and click ... Let's walk through one of the demo scenarios. The desired behavior is that whenever...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am able to reproduce by writing a long line without hitting an enter. If you copy paste this line in the editor you will be able to reproduce the bug. Or any long line will do. I tried.
Several users of the edX content editing platform have been experiencing this issue as well, and their engineers traced the problem back to CodeMirror and referred us to watch this issue. It is definitely affecting a live version of your product.
I sent a note to them to provide you more information, as I am unclear how edX implements CodeMirror, but I can verify that many users worldwide are experiencing this problem and we have an internal discussion board with several reports.