leptos-rs / book

The home for the Leptos book, which can be found deployed at https://book.leptos.dev
MIT License
89 stars 67 forks source link

Remove type="number" for input #100

Closed Hasnabruzzn closed 5 months ago

Hasnabruzzn commented 6 months ago

If the type is "number" you can't even enter "foo" (prevented by the browser), which goes against the purpose of this example.

gbj commented 6 months ago

That is true in Chrome, but not in Firefox or Safari (at least in the versions I just tested it in!)

Hasnabruzzn commented 6 months ago

I find Firefox' behavior strange - as Mozilla describes input type="number" with

input elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries.

As I understand HTML WHATWG Browsers are not supposed to allow non-numeric input.