This is indeed driving me a bit mad :p Having 15 AP available and watching my archer waste them moving into melee range when I just wanted her to shoot her damn crossbow is ... quite frustrating.
Use right-click to make them stop.
While it's still AP's wasted, it's not quite as bad as the ranger being melee and all AP's being gone.