aforemny / aforemny/material-components-web-elm

TextField setMin and setMax should take String, not Int

Offen
#161 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Elm
Sterne
93
Forks
20
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

[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 | `` | ``

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.