You have a non-touchpad mouse on a dock there that you're plugging into? If so, you can stop this kind of annoyance by setting scrollbars permanently on (or off) rather than auto in System Prefs->General.
Actually, try it anyway as when I first ran into this fix for such things, I didn't have what I thought was a mouse connected, but actually some non-mouse USB device reported to macOS that it also had a mouse on board for some reason.