show proper first/last item with home/end keys, taking visibility into account