3 ms·
Many of the (relatively) newfangled HTML input types exhibit this kind of half-baked behavior, coupled with a surprisingly stubborn lack of extensibility. type
by kijin 5y ago
Many of the (relatively) newfangled HTML input types exhibit this kind of half-baked behavior, coupled with a surprisingly stubborn lack of extensibility.
type="number" doesn't support thousands separators in any meaningful way.
type="date" and type="time" only display their values in the user's system locale, not the locale of the page. There's no way to change the format.
type="color" doesn't support RGBA and can't be in an empty state. If you try to unset its value, it always defaults to #000000, even in dark mode.
type="email" and similar text-like types don't offer any feedback for invalid values until you try to submit the form.
No wonder people are just using type="text" and relying on Javascript to achieve reasonable behavior.
- ezfe 5y agoWhile true that they don't show the feedback, you can use `.validationMessage` to retrieve it and show it yourself. Also, input type=email has been in Firefox, Chrome, and Safari for over a decade. It's not exactly new.