In HTML, an Input with Zero Length is Never too Small

Imagine you have an a text input with a minimum length:

<input type="text" minLength="1">

Imagine you have a reference to this element and you call `.reportValidity` or `.checkValidity`.

So long as the input is empty, it will be treated as a valid length.

You need to add the `required` attribute when you want the length to not be zero.

Comments

Popular posts from this blog

Fix Controller Input when a Game Doesn't Use Steam Input

VSC Vanishing Go Imports

En Dash with ComposeKey (Shift+AltGr)