- 🇺🇸United States mlncn Minneapolis, MN, USA
I think this is a good idea! Would welcome a patch, ideally we can still be compatible with the feature request ✨ Alert people when their text is trimmed Active
- 🇺🇸United States mlncn Minneapolis, MN, USA
One issue here is we want the trimming to happen before any other validation (at least, that is what makes sense in most use cases i have used this for or can think of), and presave happens after.
For example, if we trim a blank-spaces-only input down to nothing, that should trigger the warning on required field.
And if we clean up easy things without the person submitting the form having to do the cleanup (no leading or trailing spaces would be a reasonable constraint to have in custom logic apart from what trim does, but more than that requiring a phone number or identifying string to match a format or number of characters is common validation) and presave would force the form filler or API provider to clean up the data first as the validation would reject it before presave could happen.
We could do both, but there really should be a way to do pre-validation cleanup for both form and API data in a consistent way.