aforemny / aforemny/material-components-web-elm

TextField setMin and setMax should take String, not Int

Aperta
#161 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Elm
Stelle
93
Fork
20
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

[setMin](https://package.elm-lang.org/packages/aforemny/material-components-web-elm/latest/Material-TextField#setMin) and [setMax](https://package.elm-lang.org/packages/aforemny/material-components-web-elm/latest/Material-TextField#setMax) both have a type signature of `Maybe Int -> Config msg -> Config msg`, but I believe they should be `Maybe String -> Config msg -> Config msg`. Confusingly, the [docs for min](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/min) say, "the min attribute is a number that specifies the most negative value a form control to be considered valid." However, the examples are mostly strings, and I don't know how one would represent a minimal iso8601 date as anything other than a string. I have 2 PRs to update the MDN docs, assuming I'm not wrong about this.

**From MDN:**

Input type | Example | Example
-- | -- | --
date | yyyy-mm-dd | ``
month | yyyy-mm | ``
week | yyyy-W## | ``
time | hh:mm | ``
datetime-local | yyyy-mm-ddThh:mm | ``
number | `` | ``
range | `` | ``

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.