johndatserakis / file-upload-with-preview

🖼 Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well with or without a framework.

Home Page:https://johndatserakis.github.io/file-upload-with-preview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clear button is not working

hosseinitabar opened this issue · comments

Hello

I'm using your library. fileUploadWithPreview:imagesAdded works. fileUploadWithPreview:imageDeleted works.

But fileUploadWithPreview:clearButtonClicked is not getting fired.

I use custom-file-container__image-clear as the class of the clear button. I have not change any HTML structure.

What should I do?

Hey there. Seems to be working for me in this codesandbox. When I click the "x" above the input, I get this event triggered. Maybe take a look at this example as see if you've shifted some HTML accidentally.

Also, please make sure you're using the latest version, v4.2.0, as fileUploadWithPreview:clearButtonClicked is a newer event.