Skip to content

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

Open

Description

@justin-hackin

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.

Activity

  1. dbarbalato commented on Feb 24, 2016

    @dbarbalato
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions