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

Closed
fflewddur opened this issue Nov 18, 2020 · 7 comments
Closed

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

fflewddur opened this issue Nov 18, 2020 · 7 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development pkgsite

Comments

@fflewddur
Copy link

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 :(

@gopherbot gopherbot added this to the Unreleased milestone Nov 18, 2020
@jamalc jamalc modified the milestones: Unreleased, pkgsite/frontend Nov 18, 2020
@jamalc jamalc added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 18, 2020
@julieqiu
Copy link
Member

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

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

@gopherbot
Copy link

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>
@jamalc jamalc self-assigned this Jul 14, 2021
@jamalc
Copy link

jamalc commented Jul 14, 2021

Done.

@jamalc jamalc closed this as completed Jul 14, 2021
@gopherbot
Copy link

Change https://golang.org/cl/335669 mentions this issue: go.dev/_content: focus search input shortcut key

gopherbot pushed a commit to golang/website that referenced this issue Jul 19, 2021
On non-firefox browsers the search input is focussed
after pressing the / key to match the behavior of
pkg.go.dev.

Fixes golang/go#42704

Change-Id: I81a804a9062f78997f3161ec86d1adcb8a911c92
Reviewed-on: https://go-review.googlesource.com/c/website/+/335669
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
@julieqiu julieqiu reopened this Jul 20, 2021
@julieqiu
Copy link
Member

julieqiu commented Jul 20, 2021

Reopened because of #47294.

@gopherbot
Copy link

Change https://golang.org/cl/336250 mentions this issue: go.dev/_content: focus search input shortcut key

@hyangah hyangah added the pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development label May 20, 2022
@rsc rsc unassigned jamalc Jun 23, 2022
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
On non-firefox browsers the search input is focussed
after pressing the / key to match the behavior of
pkg.go.dev.

Fixes golang/go#42704

Change-Id: I81a804a9062f78997f3161ec86d1adcb8a911c92
Reviewed-on: https://go-review.googlesource.com/c/website/+/335669
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
This reverts CL 335969.

Reason for revert: broken tests fixed.

Fixes golang/go#42704.

Change-Id: Ie7090d256b2d93fb222659f5c5494a3589c48e59
Reviewed-on: https://go-review.googlesource.com/c/website/+/336250
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development pkgsite
Projects
None yet
Development

No branches or pull requests

5 participants