The owner should have it on a lead if it is a problem dog?
But they often don't, and that is where the problem is.
Would be much easier if all dogs had to be on a short lead when out in public.
When people consider getting a dog, they know their personal living circumstances i.e. large fenced garden or small high rise flat.
They also know the area they live in i.e. suitable places to walk a dog.
Those things don't seem to be taken into account and the public keep reciting the same old trope about there not being bad dogs, just bad owners.
It is not the owners jumping up on people and biting them, it is the dog. Putting it on a short lead will solve a lot of the problem.