-
Bug
-
Resolution: Fixed
-
P3
-
7u6, 8
Textfields, unlike buttons, will by default shrink their vertical size when the container they're in is shrinking. This is IMO the wrong behaviour as a textfield is not very useful when its text can't be seen.
To reproduce:
Add some buttons, textfields and a ListView to a VBox. Resize the window vertically. What happens as the window gets so short that there is not enough space for the children at their initial height?
First: the buttons keep their height, as expected. The ListView is shrinking. Fine. But the textfields are shrinking as well!
Then as the textfields have reached their minimum size, the ListView continues shrinking, while the buttons keep their size while being cropped out of the scene.
The expected and intuitive behavivour would be for the textfields to behave identical to the buttons.
We can get this behaviour with setMinHeight(Control.USE_PREF_SIZE) on the textfields. (For some reason, as we have seen, this is not necessary on buttons. Why?) However, this should IMO be the default.
Bottom line: textfields should have usable behaviour out of the box, without having to tweak them manually.
To reproduce:
Add some buttons, textfields and a ListView to a VBox. Resize the window vertically. What happens as the window gets so short that there is not enough space for the children at their initial height?
First: the buttons keep their height, as expected. The ListView is shrinking. Fine. But the textfields are shrinking as well!
Then as the textfields have reached their minimum size, the ListView continues shrinking, while the buttons keep their size while being cropped out of the scene.
The expected and intuitive behavivour would be for the textfields to behave identical to the buttons.
We can get this behaviour with setMinHeight(Control.USE_PREF_SIZE) on the textfields. (For some reason, as we have seen, this is not necessary on buttons. Why?) However, this should IMO be the default.
Bottom line: textfields should have usable behaviour out of the box, without having to tweak them manually.