#34488: ClearableFileInput widget forgets "Clear" selection when form is not
valid
-------------------------------------+-------------------------------------
Reporter: bmihelac | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 4.1
Severity: Normal | Resolution:
Keywords: admin, forms, | Triage Stage:
ClearableFileInput | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by bmihelac:
Old description:
> ClearableFileInput widget forgets "Clear" selection when form is not
> valid, that causes file would not be deleted once when form is valid
> again. This can be inconvinient, especially for forms with many fields.
>
> To reproduce:
>
> 1. Choose admin for any model instance where attachment is not required
> and has some validation,
> 2. check "Clear" next to the attachment, and change the form, so
> validation would fail,
> 3. Save form, validation error would occur, attachment and "Clear" would
> be empty
> 4. make form valid again and Save, attachment woult not be cleared
>
> (I am attaching example screenshots)
>
> [[Image(https://code.djangoproject.com/attachment/ticket/34488/clearable-
> file-input-before.png)]]
>
> [[Image(https://code.djangoproject.com/attachment/ticket/34488/clearable-
> file-input-validation-error.png)]]
>
> [[Image(https://code.djangoproject.com/attachment/ticket/34488/clearable-
> file-input-validation-success.png)]]
New description:
ClearableFileInput widget forgets "Clear" selection when form is not
valid, that causes file would not be deleted once when form is valid
again. This can be inconvinient, especially for forms with many fields.
To reproduce:
1. Choose admin for any model instance where attachment is not required
and has some validation,
2. check "Clear" next to the attachment, and change the form, so
validation would fail,
3. Save form, validation error would occur, attachment and "Clear" would
be empty
4. make form valid again and Save, attachment woult not be cleared
(I am attaching example screenshots)
[[https://code.djangoproject.com/attachment/ticket/34488/clearable-file-
input-before.png]]
[[https://code.djangoproject.com/attachment/ticket/34488/clearable-file-
input-validation-error.png]]
[[https://code.djangoproject.com/attachment/ticket/34488/clearable-file-
input-validation-success.png]]
--
--
Ticket URL: <https://code.djangoproject.com/ticket/34488#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701877ab22380-63f531a5-22a1-49e8-8d5e-60c7f788ff4b-000000%40eu-central-1.amazonses.com.