BlazorInputFile icon indicating copy to clipboard operation
BlazorInputFile copied to clipboard

How can i clear the value of input element?

Open herubber opened this issue 6 years ago • 8 comments

OnChange event has no emitted when I upload a single file again ~!

herubber avatar Sep 30 '19 07:09 herubber

We are suffering from the same issue. When the same file is uploaded, we get no event. Looking into a fix.

davidnmbond avatar Oct 07 '19 21:10 davidnmbond

OnChange event has no emitted when I upload a single file again ~!

We only observed this happening when it was the same file that was dropped as the input had not changed as such.

danielabbatt avatar Oct 07 '19 22:10 danielabbatt

EDIT: THE ISSUE IS NOW FIXED AND THE BELOW WORKAROUND SHOULD NOT BE REQUIRED

Mars Attacks Alien: "HACK! HACK-HACK!"

OK, here's a workaround:

@if (DoubleBuffer)
{
	<InputFile OnChange="FileUploaded" />
}
else
{
	<InputFile OnChange="FileUploaded" />
}

and, at the end of FileUploaded():

DoubleBuffer = !DoubleBuffer;

davidnmbond avatar Oct 07 '19 22:10 davidnmbond

Thanks David. Its not ideal, but it works.

sgbooth avatar Oct 19 '19 14:10 sgbooth

Is there already a real solution for this issue?

rvdroer avatar Dec 03 '19 21:12 rvdroer

I tried implementing the proposed workaround, with the effect that now two uploads work, but the third one fails.

BtbN avatar Sep 15 '20 16:09 BtbN

I tried implementing the proposed workaround, with the effect that now two uploads work, but the third one fails.

I believe this issue is now fixed and the workaround is no longer required.

davidnmbond avatar Sep 16 '20 08:09 davidnmbond

The issue is definitely still happening for me on the latest version.

BtbN avatar Sep 16 '20 10:09 BtbN