leptos-rs / book

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

Remove type="number" for input #100

Closed Hasnabruzzn closed 2 weeks ago

Hasnabruzzn commented 1 month 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 1 month ago

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

Hasnabruzzn commented 1 month 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.