Type-specific input fields cause cross-browser issues and wrong error messages
|Reported by:||sehmaschine||Owned by:||nobody|
|Cc:||sehmaschine@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Django recently introduced a NumberInput which is rendered with type="number". While this seems like a good idea at first view, it leads to a couple of issues with different browsers:
a) Safari removes (!) any invalid values from this input field. This leads to unpredictable situations when trying to save with the admin.
b) Other browsers render non stylable error messages before (!) saving the form: This contradicts the standard Django form behaviour with the admin, when error messages are shown after (!) the form is being submitted.
I suggest using type="text" for any NumberInput or remove the field altogether. The current behaviour with this field is cross-browser madness and a conflict with how Django handles errors with forms.
Change History (12)
comment:1 Changed 3 years ago by
|Summary:||NumberInput cross-browser issues and wrong error messages → Type-specific input fields cause cross-browser issues and wrong error messages|
|Triage Stage:||Unreviewed → Accepted|