Skip to content

Commit c67c745

Browse files
DOC - Fix search UI description (#1988)
Co-authored-by: Daniel McCloy <[email protected]>
1 parent 287f002 commit c67c745

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

docs/user_guide/search.rst

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,25 @@
22
Search bar / search button
33
==========================
44

5-
By default, the search input field is hidden, and there is a search button
6-
(a magnifying glass icon :fas:`search`) in the top navbar.
7-
The search input field will be displayed when a user either:
5+
On narrow viewports, users can access search by clicking the magnifying glass
6+
icon (:fas:`search`) in the :ref:`layout-header`. On wide viewports, the
7+
magnifying glass icon, search input field, and keyboard shortcut for focusing
8+
the search input field are all shown. The keyboard shortcut is:
89

9-
- Clicks the search button in the header.
10-
- Presses the keyboard shortcut :kbd:`Ctrl` + :kbd:`K` (Linux, Windows) or :kbd:`` + :kbd:`K` (macOS).
10+
* :kbd:`Ctrl` + :kbd:`K` (Linux, Windows)
11+
* :kbd:`` + :kbd:`K` (macOS)
1112

1213
You can also configure some aspects of the search button and search field, described below.
1314

1415
Configure the search field position
1516
-----------------------------------
1617

17-
The position of the search *button* is controlled by ``search-button`` and by default is included in ``html_theme_options["navbar_persistent"]``; you may move it elsewhere as befits your site's layout, or remove it.
18-
You can also add an always-visible search field to some/all pages in your site by adding ``search-field.html`` to one of the configuration variables (e.g., ``html_sidebars``, ``html_theme_options["footer_start"]``, etc.).
18+
The position of the search *button* is controlled by ``search-button`` and by
19+
default is included in ``html_theme_options["navbar_persistent"]``; you may move
20+
it elsewhere as befits your site's layout, or remove it. You can also add an
21+
always-visible search field to some/all pages in your site by adding
22+
``search-field.html`` to one of the configuration variables (e.g.,
23+
``html_sidebars``, ``html_theme_options["footer_start"]``, etc.).
1924

2025
For example, if you'd like the search field to be in your sidebar, add it to
2126
the sidebar templates like so:
@@ -37,7 +42,14 @@ following configuration:
3742
3843
.. warning::
3944

40-
If a page includes *both* the search button and an always-visible search field, the keyboard shortcuts will focus on the always-visible field and the hidden search field overlay will not display. *This may not be what you want:* on small screens (i.e. mobile devices) the sidebars may be hidden in a drawer, and if the persistent search field is there, it may receive focus without actually being made visible. It is **strongly recommended** that you use *either* the search button and the hidden/overlaid field that comes with it, *or* use a persistent search field in a place that makes sense for your layout.
45+
If a page includes *both* the search button and an always-visible search
46+
field, the keyboard shortcuts will focus on the always-visible field and the
47+
hidden search field overlay will not display. *This may not be what you want:*
48+
on small screens (i.e. mobile devices) the sidebars may be hidden in a drawer,
49+
and if the persistent search field is there, it may receive focus without
50+
actually being made visible. It is **strongly recommended** that you use
51+
*either* the search button and the hidden/overlaid field that comes with it,
52+
*or* use a persistent search field in a place that makes sense for your layout.
4153

4254

4355
Configure the search bar text

0 commit comments

Comments
 (0)