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

Add autofocus to input field #16

Merged
merged 2 commits into from
May 10, 2020
Merged

Add autofocus to input field #16

merged 2 commits into from
May 10, 2020

Conversation

Kombustor
Copy link
Contributor

Supported in all major browsers, allows the user to immediately start typing after loading the page.

Supported in all major browsers, allows the user to immediately start typing after loading the page.
@benbusby benbusby self-requested a review May 10, 2020 17:12
Copy link
Owner

@benbusby benbusby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be working for me on all current browsers aside from Firefox (only tested v76, macOS). Do you have a way of testing a fix that would include support there as well? If not, I make a note of it and look into it later.

@benbusby
Copy link
Owner

Just the one small comment. Let me know your thoughts and I'll merge accordingly.

@Kombustor
Copy link
Contributor Author

Kombustor commented May 10, 2020

This seems to be a firefox bug. I currently don't have it installed, but it should be supported.

We could focus the element by using JS (document.getElementById('search-bar').focus() on page load), but this is certainly not the best solution. And it didn't work for me in Chrome using the console.

EDIT: We could implement both, and the JS solution is a "backup" solution.

@Kombustor
Copy link
Contributor Author

Does it work for you in firefox like this? @benbusby

@benbusby
Copy link
Owner

Hmmm no, the updated autofocus field didn't fix it. I'll still merge this in since it seems to be working everywhere else, but I'll make a separate issue for looking into it further on Firefox.

Thanks for contributing!

@benbusby benbusby merged commit 1798b60 into benbusby:master May 10, 2020
@Kombustor Kombustor deleted the patch-1 branch May 10, 2020 21:33
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

Successfully merging this pull request may close these issues.

2 participants