The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript On body click, hide search Re: On body click, hide search


You can keep that for now, I would add focus on the input element though so users can start typing right away.

The problem with `stopPropagation` is that when you have other code somewhere on the page that relies on `$(document).click(…);`, it breaks when the user clicks on `.find` or `.search`.