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.

Caret Position = InlineCssTextArea .getText().length() but it doesn't scroll vertically to the bottom

See original GitHub issue
  • Java Version: jdk1.8.0_112

  • RichTextFX Version: richtextfx-fat-0.6.10.jar

I am using :

InlineCssTextArea textArea = new InlineCssTextArea();
textArea.setEditable(false);
textArea.setFocusTraversable(false);

and i am trying to scroll programmatically at the bottom :

//It returns the maximum length of the InlineCssTextArea  `text`
System.out.println(textArea.getText().length());
System.out.println(textArea.getCaretPosition());
   		    
//It doesn't scroll to the end
textArea.positionCaret(textArea.getText().length());

The problem is that the length of InlineCssTextArea text is 830 even if the caret is positioned at 830 it doesn’t scroll to the bottom…

screenshot49984

Is it a bug?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
goxr3pluscommented, Jan 26, 2017

So the issue is maybe done … 😃

1reaction
JordanMartinezcommented, Jan 26, 2017

Also, I exposed more API in #418 that can accomplish what you desire with show-related methods. For example:

InlineCssTextArea area = // creation code;
area.showParagraphAtBottom(area.getParagraphs().size() - 1);

However, we haven’t made a new release with that code yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Caret Position = InlineCssTextArea .getText().length ...
Caret Position = InlineCssTextArea .getText().length() but it doesn't scroll vertically to the bottom.
Read more >
JavaFX : After setting text in textArea, setting scroll to bottom in ...
I'm setting caret's position at end of text using length of text. logs.setText(logText); logs.positionCaret(logText.length());. It is working for me. :).
Read more >
GenericStyledArea (richtextfx 0.10.3 API) - javadoc.io
If there is no call to requestFollowCaret() at the end of that code, ... will scroll to the top of the document and...
Read more >
GenericStyledArea (richtextfx 0.8.0 API) - FXMisc
If there is no call to requestFollowCaret() at the end of that code, the area will not auto-scroll to that section of the...
Read more >
Using the scrolling commands - IBM
When the cursor is within a scrollable field, scrolling enables you to ... Within a scrollable field, it is one column less than...
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