-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caret Position = InlineCssTextArea .getText().length() but it doesn't scroll vertically to the bottom #433
Comments
Are you using |
Hello Jordan Martinez , thanks for fast reply . I have tried your recommendation with different ways but again that Best Regards. |
@goxr3plus Can you provide a simple Application that reproduces the bug? I could probably help troubleshoot what's going on later on today as I'm not as familiar with the |
Below is a simple working example showing the problem . I had run it on Window 10: I will be very glad to download the newer version of RichTextFX but the links seem to be dead ( https://github.com/TomasMikula/RichTextFX/releases/download/0.7-M3/richtextfx-0.7-M3.jar ) , or those who working are giving as option the version
|
The first link is the correct link. The second one is the dead link. Looks like you missed a "v" |
Or was the deadlink on the ReadMe ? |
I'm pretty sure your code should work, so I'm not sure what's causing the bug. I can reproduce it on my end on Linux. |
In the 0.7-M3 release, you'll use the code: area.moveTo(area.getLength());
area.requestFollowCaret(); |
Thanks for quick reply , i have updated to 1)No scroll bars by default on the 2)Using:
moves the caret to the correct position but the scroll pane isn't even scrolling.... Extra 😃 : The code (with all different tries):
|
Ah! Sorry! We decoupled the scroll pane from the area in one of the releases before that one. Now you need to wrap it in a InlineCssTextArea area = // creation code;
VirtualizedScrollPane<InlineCssTextArea> vsPane = new VirtualizedScrollPane<>(area);
GridPane root = new GridPane();
root.add(vsPane, 0, 0); |
Try this code. I noticed that when import org.fxmisc.flowless.VirtualizedScrollPane;
import org.fxmisc.richtext.InlineCssTextArea;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;
import javafx.stage.Stage;
/**
* @author Alexander
*
*/
public class Tester extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Testing InlineCssTextArea Vertical ScrollBar");
// --------------------------------------------------
InlineCssTextArea textArea = new InlineCssTextArea();
// textArea.setEditable(false);
textArea.setFocusTraversable(false);
textArea.setMinSize(500, 200);
// textArea.setWrapText(true);
VirtualizedScrollPane<InlineCssTextArea> vsPane = new VirtualizedScrollPane<>(textArea);
vsPane.setMaxWidth(Double.MAX_VALUE);
vsPane.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(vsPane, Priority.ALWAYS);
GridPane.setHgrow(vsPane, Priority.ALWAYS);
// -------root
GridPane root = new GridPane();
root.setMaxWidth(Double.MAX_VALUE);
root.setMaxHeight(Double.MAX_VALUE);
root.add(vsPane, 0, 0);
// Append some text to the textArea
for (int i = 0; i < 200; i++)
textArea.appendText("I is [" + i
+ "] some text some text some text some textsome text some text text some text text some text text some text text some text text some text text some text\n");
// Below I am trying to move the Vertical ScrollBar to the Bottom
textArea.moveTo(textArea.getLength());
textArea.requestFollowCaret();
// -------------------------------------------------
// Scene
Scene scene = new Scene(root, 500, 200);
// Show Stage
primaryStage.setScene(scene);
primaryStage.show();
// focus area so can see the caret
textArea.requestFocus();
}
public static void main(String[] args) {
launch(args);
}
} |
Also, I exposed more API in #418 that can accomplish what you desire with InlineCssTextArea area = // creation code;
area.showParagraphAtBottom(area.getParagraphs().size() - 1); However, we haven't made a new release with that code yet. |
Well done , thank you very much!! I also fixed the problem with the inline styles not working :) 👍 |
So the issue is maybe done .... :) |
@goxr3plus What's your issue now? |
Eveything is working perfect no issues :) . Thanks for help. |
Java Version: jdk1.8.0_112
RichTextFX Version: richtextfx-fat-0.6.10.jar
I am using :
and i am trying to scroll programmatically at the bottom :
The problem is that the length of
InlineCssTextArea
text is830
even if the caret is positioned at830
it doesn't scroll to the bottom...Is it a bug?
The text was updated successfully, but these errors were encountered: