question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Putting the caret behind the character and pressing the enter causes the creation of an empty space at first

See original GitHub issue

I 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

  1. Make the caret behind the number 0
  2. Press enter repeatedly until you reach the end of the window, you will notice the text stops descending (continue to press enter)
  3. 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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JordanMartinezcommented, May 14, 2018

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, call showParagrahAsLast (something like that) using the argument lastParagraphIndex - 1). You might also want to override the default behavior with your own so that the enter does not trigger a requestFollowCaret() call.

0reactions
saifalmutorycommented, May 14, 2018

Yes, that’s exactly what I’m trying to say

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found