Prevent the position indicator bar from going beyond the boundaries.