﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34488	"ClearableFileInput widget forgets ""Clear"" selection when form is not valid"	bmihelac	nobody	"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)]]
"	Bug	new	Forms	4.1	Normal		admin, forms, ClearableFileInput		Unreviewed	0	0	0	0	0	0
