Skip to content
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

set caret unmanaged #372

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions rta/src/main/java/com/gluonhq/richtextarea/ParagraphTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ public Layer(int start, int end, boolean isTableCell) {
textFlow.setOnMousePressed(this::mousePressedListener);

caretShape.setFocusTraversable(false);
caretShape.setManaged(false);
caretShape.getStyleClass().add("caret");
selectionShape.getStyleClass().setAll("selection");
textBackgroundColorPaths.addListener(this::updateLayer);
Expand All @@ -393,9 +394,7 @@ public Layer(int start, int end, boolean isTableCell) {

@Override
protected double computePrefHeight(double width) {
// take into account caret height: whether it is visible or not,
// the layer's height doesn't change
return Math.max(caretShape.getLayoutBounds().getHeight(), textFlow.prefHeight(textFlow.getPrefWidth()) + 1);
return textFlow.prefHeight(textFlow.getPrefWidth()) + 1;
}

@Override
Expand Down
Loading