[FileUpload control] DeleteFileIcon missing if UploadCompleted property is bound in markup

without UploadCompleted="{command: ProcessSheetPDFUploadDataAsync()}":

image

with it:

image

image

I don’t think this is expected behaviour because I don’t see anything mentioned about it in FileUpload | DotVVM Documentation

This complicates things because the FileUpload control is part of a complex form with various validated fields inside a ModalDialog popup that the user has to close and reopen to choose another file instead of the one already uploaded. Reopening the popup causes the popup VM to be nullified and reinstantiated (which is the way you recommend structuring complex imbricated VMs as to deal with validations at different levels), the user loosing all the data/information filled in the form.

For some reason, this is explicitly handled in the FileUpload control. This condition was added in a single commit, so it is 100% percent intentional, I just don’t understand why :man_facepalming:

if (!IsPropertySet(UploadCompletedProperty))
{
    item.Children.Add(CreateDeleteFileButton());
}

I think that you can emulate the delete button by removing the file from the collection in a custom button