If losing position after switching is a problem then you need to zero after each switch. Regardless how you do it you can't expect that the position is the same after switching.

However several people mentioned switching only STEP and DIR. That will not work well. You MUST also switch the GND as a minimum, but if you use the EN for any of the drivers then you must include that also.