This “issue” happens when you type something in your search input field.
After seeing list of matching products (which appears under that field), you select something using your mouse and hit ‘Enter’.
Instead of going to the search results, the search engine acts like you’ve selected a product from a list.
Let me show you how to deal with it via simple trick.
Solution for this is quite simple. We need to catch a moment when ‘Enter’ key is pressed and prevent from executing any next javascript actions – and just send a form.
Find:
lastKeyPressCode = event.keyCode;
Add after:
if(lastKeyPressCode == 13) { $("#searchbox").trigger('submit'); return false; }
In jQuery each key has its own code number. ‘Enter’ key is 13.
That’s why we are here catching if last pressed key code is belonging to 13. If so, we prevent any further action and submit a form programatically.