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

DatePicker expands horizontally infinitely #1245

Open
Bawnorton opened this issue Jul 26, 2022 · 4 comments
Open

DatePicker expands horizontally infinitely #1245

Bawnorton opened this issue Jul 26, 2022 · 4 comments

Comments

@Bawnorton
Copy link

Bawnorton commented Jul 26, 2022

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.

Screen.Recording.2022-07-26.at.5.23.35.PM.mov
@Android-X13
Copy link

Are you on a Mac by any chance?

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

@Bawnorton
Copy link
Author

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.

@adiora
Copy link

adiora commented Dec 30, 2022

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

@preland
Copy link

preland commented Jan 13, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants