-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Feature Request: Focusing search results when directly navigating to rustdoc search #86882
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
The search page is actually part of rustdoc, docs.rs just hosts it for non- |
Oh I didn't realise -- thanks for that! |
The focus on the search input was ruled out in #77333 because it prevented to scroll the page with the spacebar. However, in what you suggested, it wouldn't prevent it. I think we should go for it. What do you think @rust-lang/rustdoc ? |
Yeah if it's directly navigated to it makes sense Though actually what I want is a query parameter that will also navigate directly to the first result on your behalf so that I can set up my custom searches to use it. |
@Manishearth You mean like this: #85876 ? ;) |
Oh we landed that cool! |
Thanks for linking the related issues / PRs @GuillaumeGomez ! I'm wondering if this solution breaks that premise also, as although you can still use the spacebar to scroll the page, up/down won't scroll anymore. Is this a reasonable compromise for both sides of things, or still just the same issue? |
Up/down would still work actually. We made a lot of changes recently on the search results, so now the event isn't only when you are focused on the search input but also when you are focused on a search result "row". So in this regard, it would be perfectly fine. |
Ah okay, so please correct me if I'm wrong here but as I understand it, we would only be making navigate to the first result, and up/down will still simply scroll the page rather than navigating through the search results? |
No, if a search result is focused, up/down would go through the search results, not scroll the page. However, the spacebar would scroll. |
When users type something like
!rust Box
into a search engine like DuckDuckGo, it will navigate you to the docs.rs std search like this: https://doc.rust-lang.org/std/?search=BoxThe behavior I would like to see is that once I reach the search page, I can simply hit
Enter
to navigate to the first result:std::boxed::Box
, or alternatively navigate between the different options just by immediately using the arrow keys -- i.e. not having to use the mouse. The current behavior is that I have to either click on the option I want with my mouse, or click into the search bar before I'm able to then use the arrow keys /Enter
to get to my option.Is it a possibility to make it so that when a search query page is directly navigated to, it can allow you to immediately interact with the search results via keyboard? Obviously we wouldn't want to steal input focus away from a user who is still typing their query in however, so that's an important distinction.
I'm also happy to have a go at implementing this feature myself, assuming this is something that people are happy to see integrated.
Cheers!
The text was updated successfully, but these errors were encountered: