aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/app.py b/app.py
index 5e45618..282b4e4 100644
--- a/app.py
+++ b/app.py
@@ -771,6 +771,25 @@ with st.container():
st.divider()
+# ── ⌘K / Ctrl+K shortcut — focuses sidebar ticker search ─────────────────────
+components.html(
+ "<script>"
+ "document.addEventListener('keydown', function(e) {"
+ " if ((e.metaKey || e.ctrlKey) && e.key === 'k') {"
+ " e.preventDefault();"
+ " 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) {"
+ " inputs[i].focus(); inputs[i].select(); break;"
+ " }"
+ " }"
+ " }"
+ "});"
+ "</script>",
+ height=0,
+ scrolling=False,
+)
+
# ── Main Content ──────────────────────────────────────────────────────────────
if st.session_state["active_tab"] == "macro":