Giter VIP home page Giter VIP logo

Comments (5)

seanadkinson avatar seanadkinson commented on July 17, 2024

Hmm, it's just a <input type="file"/> that is rendered. Are you wanting the entire thing to be hidden? Or just the field to be cleared out?

If you want it to be hidden, I'd recommend just use a normal state flag to not render the component.

If you want it to be cleared out, we may want to add a component method that allows that, but I'd imagine you probably just want to hide it.

Am I understanding correctly? Let me know if not, thanks!

from react-s3-uploader.

StanBoyet avatar StanBoyet commented on July 17, 2024

Hi Sean, thanks for your answer.
Yes, what I meant was the input to be cleared after upload. Sorry, my question was really unclear :)

from react-s3-uploader.

seanadkinson avatar seanadkinson commented on July 17, 2024

I just pushed a branch up called clear-input. Can you check it out and see if it works for your purposes? I'm not able to run it to test at the moment.

The branch adds a clear method to the ReactS3Uploader component.

So if you have this in a parent component:

<ReactS3Uploader ref="uploader" ... />

Then you should be able to clear with:

this.refs.uploader.clear();

I believe you can just add this to your package.json to see if it works for you:

react-s3-uploader: 'git://github.com/odysseyscience/react-s3-uploader#clear-input'

If all looks good (and you don't mind testing on a couple browsers) I'll merge and release an update.

from react-s3-uploader.

henryboldi avatar henryboldi commented on July 17, 2024

πŸ‘ Looks good

from react-s3-uploader.

seanadkinson avatar seanadkinson commented on July 17, 2024

Pushed v1.1.17 to npm, which includes the clear method.

from react-s3-uploader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.