I have a TextArea anchored to the top, left and right of an AnchorPane. Whenever the window is resized to be smaller (which resizes the AnchorPane and TextArea), scroll bars will show up on the TextArea, even though the text isn't even close to filling up the whole area.
The behaviour is inconsistent, sometimes it will show both scroll bars, sometimes just horizontal, and sometimes none. You can make the scroll bars disappear by making the window bigger.
Here is the FXML for the TextArea:
<TextArea fx:id="teamDescription" layoutX="10.0" layoutY="107.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#handleTextAreaKeyPress" prefHeight="42.0" prefWidth="380.0">
<VBox.margin>
<Insets bottom="10.0" />
</VBox.margin>
</TextArea>
Is this an issue with JavaFX? Because I can't think of anything I could have done wrong.