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

focus wrong for unchanged search after mousing over search results #79962

Closed
ijackson opened this issue Dec 12, 2020 · 6 comments · Fixed by #84462
Closed

focus wrong for unchanged search after mousing over search results #79962

ijackson opened this issue Dec 12, 2020 · 6 comments · Fixed by #84462
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ijackson
Copy link
Contributor

This one is a relatively minor bug, since it only happens if you try to search for the same thing you are looking at, which is not a very natural thing to do. But I thought I would report it anyway.

Steps to reproduce

  1. Go to the front page of the std results from rustdoc
  2. Click in the search box at the top of the page
  3. Type in assert (as an example search term) and hit Return
  4. If your rustdoc version has the bug rustdoc help popup appears in every new tab when no web local storage #79960, and you have cookies disabled or are viewing the docs via a file:// url, click anywhere outside the help popup to dismiss it
  5. See that some search results are displayed.
  6. Move the mouse pointer over the search results. A moving highlight is displayed.
  7. Move the mouse pointer over the search box, and left click, to focus the search box
  8. Hit return to search for the same thing again

Expected results

The same search is performed again, so the page reloads with little change.

Actual results

Whatever search result you last moused over, which has the highlight shown, is visited.

@rustdoc modify labels +T-rustdoc -A-rustdoc-ui

@ijackson

This comment has been minimized.

@ijackson

This comment has been minimized.

@ijackson
Copy link
Contributor Author

@rustbot modify labels +T-rustdoc -A-rustdoc-ui

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Dec 12, 2020
@ijackson
Copy link
Contributor Author

@rustbot modify labels +A-rustdoc-ui

Sorry for the rustbot flail!

@rustbot rustbot added the A-rustdoc-ui Area: rustdoc UI (generated HTML) label Dec 12, 2020
@GuillaumeGomez
Copy link
Member

This is a tricky issue because you're supposed to be able to "click" on an item without moving the mouse by using up and down arrows and then press return. So, what I suggest is that in case you give back the focus to the search input, we clear the currently focused item.

Also: rustdoc doesn't run the search if it's the same input.

@jsha
Copy link
Contributor

jsha commented Apr 22, 2021

Related #84384.

Another way to accomplish this would be to base the up/down arrow selection on focus. Then when you click in the search box, that would take focus away from the item that had been highlighted. Mouse movements wouldn't update focus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants