JFXtras / jfxtras

A supporting library for JavaFX, containing helper classes, extended layouts, controls and other interesting widgets.
http://jfxtras.org
Other
599 stars 123 forks source link

Popup not showing properly #71

Closed Maxoudela closed 7 years ago

Maxoudela commented 7 years ago

Hi guys,

I have an issue with the LocalDateTextField (and others that uses the Textfield).

Basically, I'm adding the LocalDateTextField into a cell of a SpreadsheetView (of ControlsFX - like a TableView). And I want to show directly the popup. But since the TextField has not been shown somehow, its height is not set. Therefore the code in CalendarTextFieldSkin : popup.show(textField, NodeUtil.screenX(getSkinnable()), NodeUtil.screenY(getSkinnable()) + textField.getHeight());

is wrong and the popup is shown above the TextField.

I don't have a sample test case to reproduce it unfortunately. My solution consists of preventing that case by looking to the real height if necessary like that : double height = textField.getHeight() == 0.0 ? textField.prefHeight(-1): textField.getHeight();

I can provide a pull request if you want.

tbee commented 7 years ago

Thanks for reporting. Please do!

Maxoudela commented 7 years ago

Do I need to add a test?

I don't really know how to reproduce that, it's a bit of a timing issue I guess..

tbee commented 7 years ago

I would not know how to reproduce that either, so skip the test.

Maxoudela commented 7 years ago

Resolved by pull request #72