Auto-add mailto: prefix onchange - #83
Conversation
rugk
left a comment
There was a problem hiding this comment.
I'm not sure how useful this change will be because the validation error is shown as the user is typing
IMHO, yes, this is definitively a big problem.
do you think it would be better to check after each key press (or more precisely, 'oninput')?
If that solves the above problem, yes, it may be a way to go.
Otherwise some UX ideas:
- prevent the validation trigger until the focus is lost (blur) and only then also add the
mailto:prefix, if needed (before validation of course) - defer validation for some ms or so (to be tested if that makes sense)
- or add two validations (one for not-yet-complete emails and one for complete validation at the end)
- …
That just as some brainstorming… it all comes down to testing the ideas.
|
Hi @rugk I went with this option, which I think works really well and avoids any red appearing on the screen in most cases, which is great
This is ready for review @nightwatchcyber |
Resolves #81 (comment)
Blurring the input in any way will check if the Contact input is in the form
user@domain, where each ofuseranddomainhave length at least 1 and contain only alphanumeric characters_+.-If it matches, then the prefix
mailto:is added.I'm not sure how useful this change will be because the validation error is shown as the user is typing, so they may try to fix it themselves instead of blurring the input. @nightwatchcyber / @rugk do you think it would be better to check after each key press (or more precisely, 'oninput')?