This happen only if the button are inside the Scroll Box?
Cause I got almost the same problem, like a explain in this link.
And yes, u can turn off the dotted line…go to Edit → Project Settings → User Interface and then look for Focus → “Render Focus Rule”.