updated keypress event in search to prevent default if enter key is pressed