Yeah, I agree with this. One of the few real flaws in their AI IMO. Sometimes I have to pull a fight back to them so I don't inconvenience them to have to move to the fight to heal. Silly companions.
Some fights can be a real dance of trying to get your companion to be in range and to 'not stand in the fire'. The Specialists on Makeb comes to mind (completing it solo). Sometimes he'll move the fight out of range so 'passive' to move the healer closer, then 'un-passive' to place him, but not too close otherwise he'll get hit by the AOE. And then he leaps to your healer or pulls him in, so it's 'passive' then run away, then 'un-passive' then run back. And then he jets up and shoots down fire, so 'passive' and run around the room clicking, then run to a good spot to put your healer, then 'un-passive' and hope to god you can get enough heals for the next round.
It would be really nice if they would prioritize group members like normal, but also try to run to them if they are also engaged in the same combat (i.e., not off somewhere on the other side of the planet aggroing other mobs). Even if the companions just stayed within roughly 15m of their player then that would solve most issues of them standing way in the back healing themselves and being useless. Also, if they made some attempt to avoid ground targeted damage that would be great. I'm pretty sure all of my companions' bums are pretty toasty from all the fire that they stand in.