Skip to content
Discussion options

You must be logged in to vote

Search is your friend 😊

Has anyone done similar? I'm particularly stumped on the first one, as the user doesn't have to click anything to search (results appear as they type), so I'm not sure what I could hook into that signals they're done writing their query.

Material for MkDocs uses the blur event to capture the semantics of "finished typing". Not perfect, but works reasonably well.

/* Set up search tracking */
if (document.forms.search) {
var query = document.forms.search.query
query.addEventListener("blur", function() {
if (this.value)
gtag("e…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by StarfallProjects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants