I had the same problem once. We taught one of my previous horses to stand still with this method. When you go to get on and they walk off back them up. Do this ever time, and don’t let them get away with it. When they do get it give them a reward, but don’t let them walk off right away. Have them stand still for a few moments, then walk off.
Hope this helps good luck💕