Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficult to understand how to trigger the file input click programatically #8

Open
justin-hackin opened this issue Feb 11, 2016 · 1 comment

Comments

@justin-hackin
Copy link

A common use case for a file input is to make it hidden and trigger a click on the input from another button. The way this is designed, it is difficult for me to understand how one could possibly do this. I tried giving the component a ref and then running "this.refs.fileImportInput.getDOMNode().click()" but I could not trigger it this way.

@dbarbalato
Copy link
Member

Hey.

So this library sets out to handle the hiding and click-delegation that you've described in one opinionated way: using a text box as the "controlling" element. Further, it was developed without consideration for programmatic interaction - just user driven events.

It seems to me like you want to use a button instead of a text box - that is something this lib definitely does not support... If that is the case, I would suggest either making a PR to add this new capability, or use the source code here as a guide in helping you achieve what you want with React.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants