Development #45152
Attribut inputmode sur les champs
0%
Description
Dans #38980,
code postal/SIREN/SIRET = <input type="number" />...
mais ça n'est pas approprié,
The type=number state is not appropriate for input that happens to only consist of numbers but isn't strictly speaking a number. For example, it would be inappropriate for credit card numbers or US postal codes. A simple way of determining whether to use type=number is to consider whether it would make sense for the input control to have a spinbox interface (e.g. with "up" and "down" arrows). Getting a credit card number wrong by 1 in the last digit isn't a minor mistake, it's as wrong as getting every digit incorrect. So it would not make sense for the user to select a credit card number using "up" and "down" buttons. When a spinbox interface is not appropriate, type=text is probably the right choice (possibly with an inputmode or pattern attribute).
— https://html.spec.whatwg.org/multipage/input.html#when-number-is-not-appropriate (via https://css-tricks.com/finger-friendly-numerical-inputs-with-inputmode/
Et donc suivre la suggestion, inputmode.
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a presque 4 ans
- Patch proposed changé de Non à Oui
- Fichier 0001-misc-add-inputmode-number-attribute-on-zipcode-etc.-.patch 0001-misc-add-inputmode-number-attribute-on-zipcode-etc.-.patch ajouté
- Statut changé de Nouveau à Solution proposée
Mis à jour par Thomas Noël il y a presque 4 ans
Il faut laisser libre la saisie pour IBAN (y'a des lettres dedans, FR...) et le numéro de sécu (parce que départements 2A et 2B pour les Corses).
Mis à jour par Frédéric Péters il y a presque 4 ans
Pour avoir du chercher, si les gens disent "numéro de sécu", peut-être que ça devrait se trouver dans le libellé, plutôt que "NIR (France)".
(branche à jour)
Mis à jour par Thomas Noël il y a presque 4 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Frédéric Péters il y a presque 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
(je l'ai aussi ajouté à la validation "nombre", que j'avais zappée).
commit f8be9e5c56ced4f805af1e6768f27a0695c92c0e Author: Frédéric Péters <fpeters@entrouvert.com> Date: Wed Jul 15 19:10:48 2020 +0200 misc: add inputmode=number attribute on zipcode/etc. widgets (#45152)
Mis à jour par Frédéric Péters il y a presque 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
misc: add inputmode=number attribute on zipcode/etc. widgets (#45152)