diff --git a/python_docs_theme/layout.html b/python_docs_theme/layout.html
index b4502ba..82b7ef4 100644
--- a/python_docs_theme/layout.html
+++ b/python_docs_theme/layout.html
@@ -48,7 +48,7 @@
{{ _('Navigation') }}
{%- if builder != "htmlhelp" %}
@@ -76,6 +76,7 @@ {{ _('Navigation') }}
{%- if not embedded %}
+
{%- endif -%}
{%- endif -%}
diff --git a/python_docs_theme/static/search-focus.js b/python_docs_theme/static/search-focus.js
new file mode 100644
index 0000000..aa5b42f
--- /dev/null
+++ b/python_docs_theme/static/search-focus.js
@@ -0,0 +1,21 @@
+function isInputFocused() {
+ const activeElement = document.activeElement;
+ return (
+ activeElement.tagName === 'INPUT' ||
+ activeElement.tagName === 'TEXTAREA' ||
+ activeElement.isContentEditable
+ );
+}
+
+document.addEventListener('keydown', function(event) {
+ if (event.key === '/') {
+ if (!isInputFocused()) {
+ // Prevent "/" from being entered in the search box
+ event.preventDefault();
+
+ // Set the focus on the search box
+ const searchBox = document.getElementById('search-box');
+ searchBox.focus();
+ }
+ }
+});
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy