Replace keypress with input event for autocomplete.