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

Allow focusing query search field via accesskey #2369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xitep
Copy link

@xitep xitep commented Dec 28, 2023

Conveniently focus the search field via alt+shift+q (e.g. in FF); the particular key is opinionated of course, but i remember "q" (for "query") being fairly standard some years ago.

@xitep xitep requested a review from a team as a code owner December 28, 2023 10:50
@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Dec 28, 2023
@GuillaumeGomez
Copy link
Member

accesskey seems to be quite tricky to use based on MDN. Not sure it's the right way to do it...

Copy link
Member

@syphar syphar left a comment

Choose a reason for hiding this comment

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

I admit I never saw accesskey being used, and never used alt+shift+something in FF.

Would it show the possible access key in the text-field itself? How would user discover this?

Is q the thing that other websites use too? Do you have an example? I see that both gitlab & github use / as direct shortcut, and not the access_key.

@syphar
Copy link
Member

syphar commented Feb 14, 2024

also, it seems like the concerns are mostly around accessibility, and issues with using multiple keys.

@xitep
Copy link
Author

xitep commented Feb 14, 2024

unfortunately, "accesskey" has got very much out of fashion on the web :( and, admittedly, is being superseded by web pages taking care of keyboard navigation (each) in their own way. it must be more than 15 years ago in the meantime, but i remember using alt+shift+q pretty frequently, especially to focus search/query fields.

i agree that it would make more sense to align with the existing shortcut machinery of docs.rs; i might give it a try if i manage to get docs.rs app running locally (but chances are rather bleak due to other responsibilities :/)

@syphar syphar added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This PR is incomplete or needs to address review comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants