handle the highlighted selected index when type in search input