Editor doesn't scroll to cursor when entering new lines
See original GitHub issueWhen entering many new lines, the cursor goes beyond the view.
The expected behavior would be to have the editor always scroll to the cursor position.
Here is a video of the issue:
So one solution I have come up with is to add the following code to the Scroll View wrapping the editor:
<ScrollView
{...}
ref={ref => this.scrollView = ref}
onContentSizeChange={(contentWidth, contentHeight) => {
this.scrollView.scrollToEnd({ animated: false });
}}
>
So now when entering new lines, the scroll view always scrolls to the end, and thus showing the cursor.
But now, there still is another problem. After entering many lines, and then deleting the lines, the cursor goes beyond the scroll view.
Here is a video showing the issue:
I would appreciate if anyone has any feedback about this or knows how to solve this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (1 by maintainers)
Top Results From Across the Web
View does not scroll to the end of the text in some ... - GitLab
The view does not scroll to the end, even if the cursor is at the last line. If I type a new line...
Read more >VIM, can't scroll through certain lines - Stack Overflow
Basically, I can only access five lines of the 13 displayed in VIM in either edit or write mode. The cursor just skips...
Read more >how to move cursor directly to the next new line? - vim
The simplest way is probably hit ctrl-o then $ . ctrl-o puts you into command mode for one command only, so the $...
Read more >TextEdit Behaving Odd on Big Sur Update - Apple Developer
The only solution I have found is to press [Delete] slowly (may be one character per second) to avoid the scroll bar jumping...
Read more >Console Virtual Terminal Sequences - Microsoft Learn
Also known as pan down, new lines fill in from the bottom of the screen ... Scroll up and down won't affect any...
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 managed to make the scroll work correctly, making the content absolute, I leave here an example of the main code, and a video to demonstrate, it may be useful for someone else:
https://user-images.githubusercontent.com/15730525/113488977-545a5980-94b9-11eb-8dff-bfdfb010d5ef.mp4
Similar Issue #114
Do u face with this issue. when u select setBold or setItalic, html will auto break into new line in android ? if this happens, try to remove
display: flex; flex-direction: column;