This is a result of the gluten that formed during kneading. If the dough is snapping back into a shorter length, leave it to rest for a couple of minutes and then continue. This will give the gluten time to relax and it won't shrink as much.