From 0abd40aeb7ad991a8b614f9f4acf002c3452a58a Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 31 Jul 2022 22:29:23 +0300 Subject: [PATCH] Only set query field when appropriate query param passed via URL - Setting query value to default option when query param wasn't passed via URL was overriding placeholder text in query field - We wanted placeholder text in field, not the query field to actually be populated by placeholder text - This clears field when user starts typing query into the query field, instead of them having to manually delete the default text populated --- src/interface/web/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/interface/web/index.html b/src/interface/web/index.html index 7ef95b42..b364f670 100644 --- a/src/interface/web/index.html +++ b/src/interface/web/index.html @@ -85,7 +85,10 @@ // Fill search form with values passed in URL query parameters, if any. window.onload = function () { document.getElementById("type").value = new URLSearchParams(window.location.search).get("t") || "org"; - document.getElementById("query").value = new URLSearchParams(window.location.search).get("q") || "What is the meaning of life?"; + var query_via_url = new URLSearchParams(window.location.search).get("q"); + if (query_via_url) { + document.getElementById("query").value = query_via_url; + } }