Closed baxyz closed 2 years ago
A validator will enforce a certain format of value, causing the prompt to be rendered again each time a validator fails. A "transformer" (see Question.Transform
field) will post-process the value entered. You can define a transformer that will clean up leading or trailing whitespace so you don't end up with those characters.
If the current offering of validators doesn't suit you, you can define your own that do the same checks but by trimming any leading/trailing space beforehand.
Thanks, that's work lovely with a custom Required
validator and a simple Transform.
After reading the docs, I didn't find any clue to trim the text typed by the user.
Am I missing something? Is there a workaround to do that?
For now, a space character is considered as a valid input for validators (
Required
,MinLength(1)
, ...)