If you have replaced the valve completely then it needs adjusting to get the water shut off level required. Do this by bending the metal arm that the ball is fixed to or by adjusting the screw if the arm is plastic.
If the arm of your ball valve is bent very slightly down, it will meet the rising water sooner and theirfore shuting off the water before it reaches the overflow. It may take a few atempts toget it just right.