When she 'pancakes' she is telling the new dog "Com'on! Let's play!" (Unless she rolls over on her back, when she sees a new dog). Common puppy behavior.
If she were my pup, I'd want to teach her to ignore the new dog and continue with what ever we were doing before the new dog came along. If I was walking with her, I'd want her to remain walking. Etc.
If she is food driven, take treats with you. The moment she begins to focus on the new dog, tell her to "Leave it" and put the treat in front of her as YOU continue to walk. Don't stop. Give her the treat as she follows the lure. Get another one and repeat till you pass the new dog. Important thing is you don't stop walking and you don't drag your pup. Use what you can to lure her focus back to you and the job at hand.
Hondo Von Dopplet L Bauernhof "Hondo"- GSD
Lilie's Tug McGraw "Tug" - Golden Retriever
Maggie - Mini Dachshund (Rescue)
Lonestar - Texas Blue Lacy
Funyon, Ashe, Soot - Barn Cats
Scooter /1/2 Arabian, Shadow, Katie / APHA