Hello,
Ran into this oddity or maybe a feature when making a validator class for some calculators I’m making.
Basically one of the most simple validation routines is to check if the field is required, and if it is, test the textfield in question for any contents. Works a like charm for single line input TextField instances, as an empty field rightfully returns a length of 0 if it has no content in it. Using multiline TextFields will always return a length of 1 regardless of whether or not anyone has entered any content into this TextField.
Its a doddle to check to see if the TextField in question is multiline or not and adjust my validation routines, but I feel like I should not have to.
Seems kinda odd if you ask me. Am I missing something here?
edit:
Hmm, seems multiline TextFields have a ‘\r’ character inserted into them by default.