aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/app.py b/app.py
index 073d629..87a6716 100644
--- a/app.py
+++ b/app.py
@@ -791,6 +791,27 @@ with st.container(key="market_bar_sticky"):
st.divider()
+# ── ⌘K / Ctrl+K shortcut — focuses sidebar ticker search ─────────────────────
+components.html(
+ "<script>"
+ "document.addEventListener('keydown', function(e) {"
+ " if (e.key === '/' && !e.metaKey && !e.ctrlKey && !e.altKey"
+ " && document.activeElement.tagName !== 'INPUT'"
+ " && document.activeElement.tagName !== 'TEXTAREA') {"
+ " var inputs = window.parent.document.querySelectorAll('input');"
+ " for (var i = 0; i < inputs.length; i++) {"
+ " if (inputs[i].placeholder && inputs[i].placeholder.indexOf('AAPL') > -1) {"
+ " e.preventDefault();"
+ " inputs[i].focus(); inputs[i].select(); break;"
+ " }"
+ " }"
+ " }"
+ "});"
+ "</script>",
+ height=0,
+ scrolling=False,
+)
+
# ── Main Content ──────────────────────────────────────────────────────────────
if st.session_state["active_tab"] == "macro":