Fix text field size not being calculated correctly