Putting the caret behind the character and pressing the enter causes the creation of an empty space at first
See original GitHub issueI do not know if the bug has been reported, I searched but could not find, The application I’m working on is very difficult to move here but I have worked a miniature application that summarizes the problem, I hope you understand me well:
Expected Behavior
- Make the caret behind the number 0
- Press enter repeatedly until you reach the end of the window, you will notice the text stops descending (continue to press enter)
- Select text from 0 to above You will notice that there is a large blank space due to pressing enter
Reproducible Demo
public class Bug extends Application {
public void start(Stage primaryStage) {
var area= new InlineCssTextArea();
area.setPrefSize(400,600);
var pane= new AnchorPane(area);
var scene= new Scene(pane);
for(var i=0;i<25;i++){
area.appendText("\n");
area.appendText(String.valueOf(i));
}
primaryStage.setScene(scene);
primaryStage.show();
}
}
Environment info:
- RichTextFX Version: <0.9.0>
- Operating System: <Windows 10>
- Java version: <10>
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Caret invisible or at wrong place with empty contenteditable ...
When elements are empty, the caret won't show up for contenteditable elements. For the first element in the testcase, the caret won't show...
Read more >Why Is My Contenteditable caret Jumping to the End in Chrome?
The problem is that your contenteditable element is a div , which by default is display: block . This is what causes your...
Read more >Pressing enter produces ^M instead of a newline - Ask Ubuntu
One solution I played with is remapping the ^M to ^J in zsh, but that seems like it wouldn't fix the root problem....
Read more >Pressing Enter Key gives space instead of newline - Super User
I'm currently working on a word document, however right now though I have this weird error where my cursor floats to the right...
Read more >Text being overwritten as I type - YouTrack Support | JetBrains
Sometimes, and seemingly at random, typing text overwrites anything anything in front of the caret, e.g., if I have the line "print 'Hello ......
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
See the
showParagraph
prefixed methods, which you’ll need to call to insure the viewport does not change (e.g. get the last visible paragraph index, insert the newline, callshowParagrahAsLast
(something like that) using the argumentlastParagraphIndex - 1
). You might also want to override the default behavior with your own so that the enter does not trigger arequestFollowCaret()
call.Yes, that’s exactly what I’m trying to say