What make of grinder are you using?
I once had a Sunbeam that was very messy. Grounds went everywhere over the bench.
I now use a Breville Smart Grinder that is very clean. The grounds drop straight down the tube from the burrs into the portafilter. If anything spills it is trapped in a grind catch tray.
With the Sunbeam the grounds go down a tube at about 45 degrees and tend to spread.
It may be cleaner to grind into a container and then dosing from that.