-
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
Constructor InlineCssTextArea(String text)
initializes area with 1 paragraph with newline characters rather than multiple paragraphs
#676
Comments
Thanks for pointing that out. Do you want to submit a PR to fix it? |
I'd need a hand to keep consistent with the ReactFX stuff (I've never used ReactFX). The problem seems to lie in this snippet: Subscription caretPopupSub = EventStreams.combine(caretBounds, caretPopup.outsideViewportValues())
.subscribe(tuple3 -> {
Optional<Bounds> opt = tuple3._1;
boolean showPopupWhenCaretOutside = tuple3._2;
if (opt.isPresent()) {
Bounds b = opt.get();
caretPopup.setX(b.getMaxX() + caretXOffset);
caretPopup.setY(b.getMaxY() + caretYOffset);
if (caretPopup.isHiddenTemporarily()) {
caretPopup.show(stage);
caretPopup.setHideTemporarily(false);
}
} else {
if (!showPopupWhenCaretOutside) {
caretPopup.hide();
caretPopup.setHideTemporarily(true);
}
}
}); It seems that before (meaning before something broke the Demo), the
But that doesn't seem to hold true any more. Am I missing something? |
This actually reveals a bigger bug.... After I looked at it more, something baffled me. We can only get the caret's bounds if the paragraph is rendered on the screen. So, if the popup adheres to the location where the caret should be if the rendered paragraph wasn't removed, then its paragraph is still being rendered (just not something we see due to the clipping of the underlying viewport). To confirm this, I printed out the visible paragraphs each time they changed.
Here's what actually appeared on my console:
Thus, the entire document is being rendered as a very long paragraph with multiple newlines inside of it, not many paragraphs for each line. |
False alarm. The issue lies with |
InlineCssTextArea(String text)
initializes area with 1 paragraph with newline characters rather than multiple paragraphs
The workaround is to use the no-args constuctor and then call the correct |
Expected Behavior
The
BoundsPopup
s should disappear when they go outside of the window.The
BoundsPopup
s should also disappear when the window isn't focused.Actual Behavior
The BoundsPopups don't disappear when they move outside the window.
The BoundsPopups don't disappear when the window isn't focused.
Reproducible Demo
See
PopupDemo.java
inrichtextfx-demos
.[]Demo
Environment info:
The text was updated successfully, but these errors were encountered: