Skip to content

InputFile cannot be reset programmatically #4

@ilonatommy

Description

@ilonatommy

Once we choose a file to upload to InputFile, there's no way of clearing the text field belonging to InputFile. Resetting the key, suggested in https://stackoverflow.com/questions/66162951/blazor-inputfile-reset-clear-value-statehaschanged-not-working does not work and a workaround of keeping a double InputFile does not look neat: SteveSandersonMS/BlazorInputFile#2.

Initial view:
{F6701033-ECD3-4456-B8BD-11C9D8B68026}

After upload:
{853BA4A5-83D9-4F86-B1B7-C462917F62B6}

After resetting the key in

fileInputKey = Guid.NewGuid().ToString();

it's still
{853BA4A5-83D9-4F86-B1B7-C462917F62B6}

If the user clicks the "Choose file" button, the `InputFile goes back to the initial view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions