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

x/pkgsite: search shortcut key doesn't work consistently across site #42704

Open
fflewddur opened this issue Nov 18, 2020 · 3 comments
Open

x/pkgsite: search shortcut key doesn't work consistently across site #42704

fflewddur opened this issue Nov 18, 2020 · 3 comments

Comments

@fflewddur
Copy link

@fflewddur fflewddur commented Nov 18, 2020

Using the '/' shortcut for search works on package/module pages (e.g., https://pkg.go.dev/flag), but doesn't work on the home page or search results pages (e.g., https://pkg.go.dev/search?q=command). I expected the shortcut keys to behave consistently across the site.

What is the URL of the page with the issue?

https://pkg.go.dev/search?q=command
https://pkg.go.dev/

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36

What did you do?

Pressed the '/' search shortcut key.

What did you expect to see?

I expected focus to move to the search box, as it does on package/module pages.

What did you see instead?

Nothing happened :(

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented May 7, 2021

The search keyboard shortcut should also work consistently across *go.dev. See #45268.

@julieqiu julieqiu changed the title x/pkgsite: Search shortcut key doesn't work consistently across site x/pkgsite: search shortcut key doesn't work consistently across site May 7, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 15, 2021

Change https://golang.org/cl/328312 mentions this issue: static/shared/keyboard: create a shared keyboard controller

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 15, 2021

Change https://golang.org/cl/328330 mentions this issue: static/{frontend,shared}: use keyboard controller in frontend

gopherbot pushed a commit to golang/pkgsite that referenced this issue Jun 16, 2021
The keyboard controller will standardize keyboard events
and centrally locate the logic for when to fire or ignore
callbacks.

For golang/go#42704

Change-Id: I0ce01db97b5188cda9fd72d3c910812ea8ae1bb2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/328312
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Jun 16, 2021
Moves the keyboard event registration to frontend.ts
to take advantage of the shared keyboard controller.
Fixes search keyboard focus on the homepage.

For golang/go#42704

Change-Id: Icfb3f88460ad0d0e00f26651a4626efdc601f611
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/328330
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants