Projet

Général

Profil

0001-kinds-add-inputmode-numeric-to-post-code-siret-widge.patch

Frédéric Péters, 25 juillet 2020 19:29

Télécharger (1,15 ko)

Voir les différences:

Subject: [PATCH] kinds: add inputmode=numeric to post code & siret widgets
 (#45152)

 src/authentic2/attribute_kinds.py | 6 ++++++
 1 file changed, 6 insertions(+)
src/authentic2/attribute_kinds.py
155 155
            validate_fr_postcode(value)
156 156
        return value
157 157

  
158
    def widget_attrs(self, widget):
159
        return {'inputmode': 'numeric'}
160

  
158 161

  
159 162
class FrPostcodeDRFField(serializers.CharField):
160 163
    default_validators = [validate_fr_postcode]
......
336 339
        value = only_digits(value)
337 340
        return value
338 341

  
342
    def widget_attrs(self, widget):
343
        return {'inputmode': 'numeric'}
344

  
339 345

  
340 346
def contribute_to_form(attribute_descriptions, form):
341 347
    for attribute_description in attribute_descriptions:
342
-