internal/frontend: keep user in current search mode

When a user is on the search page, keep them in the tab that they are
currently looking at, except for keyboard shortcuts.

This is based on whether m=<mode> is set to package or symbol.

A separate CL will fix this in the search form.

For golang/go#44142

Change-Id: I2c0e956d77d75a85064f7851a3e0866ef458ef44
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/347302
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
diff --git a/internal/frontend/search.go b/internal/frontend/search.go
index 81f3b68..cccebb8 100644
--- a/internal/frontend/search.go
+++ b/internal/frontend/search.go
@@ -403,6 +403,9 @@
 	if mode == searchModePackage {
 		return q, false
 	}
+	if mode == searchModeSymbol {
+		return q, true
+	}
 	if shouldDefaultToSymbolSearch(q) {
 		return q, true
 	}