JFoenix icon indicating copy to clipboard operation
JFoenix copied to clipboard

DatePicker expands horizontally infinitely

Open Bawnorton opened this issue 3 years ago • 4 comments

Adding a JFXDatePicker to any pane programmatically or via fxml causes it to gradually expand horizontally infinitely regardless of any constraints set on the date picker or the pane.

The Datepicker remains completely functional, see video below.

https://user-images.githubusercontent.com/18416784/181114767-ce93bc91-e618-425e-90e7-6895b52ec34f.mov

Bawnorton avatar Jul 26 '22 21:07 Bawnorton

Are you on a Mac by any chance?

Does this work: datePicker.getEditor().setMaxWidth(Control.USE_PREF_SIZE);

Android-X13 avatar Sep 03 '22 23:09 Android-X13

Are you on a Mac by any chance?

Does this work:

datePicker.getEditor().setMaxWidth(Control.USE_PREF_SIZE);

Yes on Mac, I fixed it by setting max, min and preferred size to a fixed value. Not setting one of these causes the bug, which doesn't seem to make a whole lot of sense. I couldn't find the source of the bug in the library but the aforementioned fix seemed to resolve the issue.

Bawnorton avatar Sep 11 '22 04:09 Bawnorton

Setting the font size to an odd number worked for me. weird though.

adiora avatar Dec 30 '22 16:12 adiora

Here are some of the findings I found on this issue while working on this issue:

-Width isn't modified at instantiation; this means that setting MaxWidth for the element changes nothing except for the starting point of the growth -Growth isn't constrained or influenced by window size -For some reason, the growth will become paused when moved from a higher resolution monitor to a lower resolution monitor. In addition, the issue doesn't seem to occur on the lower resolution at all (1080p). The growth continues Most (see next) of the time when moved back to a higher resolution. -Sometimes, when moved from lower to higher resolution quickly, the growth will remain stopped. The growth continues once the window is updated in any way (a button is clicked, a pop-up occurs, etc.) -I could not find a way to reduce or reset the size of the datePicker after growth. Moving to another screen would stop it, but it would continue from the same size once looked at again. Restarting is the only way to (temporarily) return the size back to normal.

Hope this helps!

preland avatar Jan 13 '24 01:01 preland