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 search box when pressing slash #130

Closed
hugovk opened this issue Jun 3, 2023 · 2 comments · Fixed by #141 or #153
Closed

Focus search box when pressing slash #130

hugovk opened this issue Jun 3, 2023 · 2 comments · Fixed by #141 or #153

Comments

@hugovk
Copy link
Member

hugovk commented Jun 3, 2023

Many websites focus the search box when the forward slash / key is pressed.

For example:

Here's how PyPI implemented it: pypi/warehouse#10395

miketheman added a commit to miketheman/python-docs-theme that referenced this issue Jul 27, 2023
When the template was made responsive, the choice was made to override
the `body_tag` fragment.
The `body_tag` block is a literal `<body>` which allows the theme developer
to set properties on the `body` tag.
See: sphinx-doc/sphinx#4140

Instead, use the `document` block as documented.
https://www.sphinx-doc.org/en/master/development/templating.html#blocks

Overriding the correct block places the `mobile-nav` section _after_ the
majority of the other HTML parts, which enables the correct function of
the `/` keyboard shortcut.

Resolves python#130
Closes python#131
Closes python#135

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@hugovk
Copy link
Member Author

hugovk commented Aug 14, 2023

Re-opening because the fix in #141 caused #144, and needs reverting (#146).

@hugovk hugovk reopened this Aug 14, 2023
@hugovk
Copy link
Member Author

hugovk commented Oct 4, 2023

Fixed by #153.

@hugovk hugovk closed this as completed Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant