You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Figure out how best to handle browser differences #11
My initial thought is that this library intentionally is a thin wrapper around HTML5 validation, and the best-practice is to always fall back on proper server-side validation should client-side validation fail for any reason. (because you can never trust the client anyways)
However, the goal of this library is to make working with forms easier, and it is nice to have a consistent experience in all browsers. If I were to scrap the reliance on HTML5 validation, we'd need to wire up lots of event handlers under the hood to handle validation in JS-land, which I think is a non-trivial amount of complexity and scope.
One option that I haven't researched very much yet is pulling in some other polyfill library to handle ironing out these differences. So far, I haven't found any that polyfill minlength specifically, so this may not address the core issue.
Another option is to use feature-detection and wire up workarounds where it makes sense. For example, minlength detection fails, so add an onInput that checks the value length and uses setCustomValidity() to communicate the failure. I'm sure there are plenty of caveats to work through with that approach, particularly to make sure that other validation attributes aren't clobbered in the process. (not to mention handling that drift when rendering the validation messages)
Anyways, there's a lot to consider because I want to keep this library clean and maintainable moving forward, while still being useful and relevant.
Activity