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

Autofocus to search-input #367

Open
usta opened this issue Aug 29, 2021 · 5 comments
Open

Autofocus to search-input #367

usta opened this issue Aug 29, 2021 · 5 comments
Labels
enhancement New feature or request good-first-issue Good for newcomers Hacktoberfest Issues that are good first picks for Hacktoberfest participants help wanted Extra attention is needed

Comments

@usta
Copy link
Member

usta commented Aug 29, 2021

It will be much easier if it autofocus search-input so user can directly write something to search when the page loaded
instead of clicking search area then write something

@usta
Copy link
Member Author

usta commented Aug 29, 2021

@captn3m0

@captn3m0 captn3m0 added enhancement New feature or request good first issue help wanted Extra attention is needed labels Aug 30, 2021
@captn3m0
Copy link
Member

Might be something worth directly proposing to the theme that we use: https://github.com/pmarsceill/just-the-docs/

@captn3m0
Copy link
Member

captn3m0 commented Sep 27, 2021

If you'd like to work on this issue, setup the project locally as per HACKING.md. Then understand the Jekyll file structure and add the new script accordingly.

Only trigger this if the user starts typing alphanumeric characters.

And finally, we have a very helpful guide for new contributors during Hacktoberfest as well.

@captn3m0 captn3m0 added the Hacktoberfest Issues that are good first picks for Hacktoberfest participants label Sep 30, 2021
@BiNZGi BiNZGi added good-first-issue Good for newcomers and removed good first issue labels Oct 16, 2023
@dirschn
Copy link

dirschn commented May 22, 2024

Hey @captn3m0, I'd be interested in taking a look at this, but was wondering whether you'd prefer I do it here or in the theme? Seems like it could be appropriate in either place.

@captn3m0
Copy link
Member

I'm okay either way as well, so no preference - pick whatever seems easier. If it works out well, we can port it as a PR to the theme quite easily later. A few suggestions on the implementation:

  1. It should be obvious to the user that their keystrokes are being hijacked and are now on the search box.
  2. Only do it when it makes sense - regular browsing should not break, so Ctrl+A, Ctrl+F, Ctrl+G etc should keep working as is. Maybe just trigger on an alphabet press.
  3. I don't have an answer for this, but several browser extensions, such as Vimium/, and accessibility features might be impacted because of this change. Keep those in mind, and see if we can minimize the impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good-first-issue Good for newcomers Hacktoberfest Issues that are good first picks for Hacktoberfest participants help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants