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

Setup to allow autoFocus to work or something similar #1145

Closed
Nate-Wilkins opened this issue Feb 15, 2022 · 5 comments
Closed

Setup to allow autoFocus to work or something similar #1145

Nate-Wilkins opened this issue Feb 15, 2022 · 5 comments

Comments

@Nate-Wilkins
Copy link

Nate-Wilkins commented Feb 15, 2022

When setting up react-dropzone there's no good way to auto focus the element.
I've tried using refs and auto focusing after mount but it doesn't work.

Is there a way to get this built directly into the library?

Does anyone know if there is a workaround to this?

Here's a sandbox demonstrating the problem.
https://stackblitz.com/edit/react-ts-kax8n9

@rolandjitsu
Copy link
Collaborator

When setting up react-dropzone there's no good way to auto focus the element. I've tried using refs and auto focusing after mount but it doesn't work.

Is there a way to get this built directly into the library?

Does anyone know if there is a workaround to this?

Could you share what you tried? Maybe a codesandbox?

@Nate-Wilkins
Copy link
Author

Sure thing! Here's a sandbox of the problem.
https://stackblitz.com/edit/react-ts-kax8n9

@rolandjitsu
Copy link
Collaborator

Sure thing! Here's a sandbox of the problem. https://stackblitz.com/edit/react-ts-kax8n9

Thanks. Yeah, the input is not displayed, so you cannot focus. Try w79ely, let me know if that's what you're looking for.

@rolandjitsu
Copy link
Collaborator

I'm thinking it may be useful to have an autoFocus 🤔

@rolandjitsu rolandjitsu self-assigned this Mar 6, 2022
rolandjitsu added a commit to rolandjitsu/react-dropzone that referenced this issue May 2, 2022
@github-actions
Copy link

github-actions bot commented May 2, 2022

🎉 This issue has been resolved in version 14.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants