Move hidden input around to match position of cursor

Why did it have to move to the end here?  Add a comment.