Avoid spacebar scrollbar and avoid jumping out of bounds