Computer problem (firefox as well)

So every once in a while, when I close a tab in Firefox, it causes this glitch, where, (in every application) every menu rapidly scrolls back to the beginning. How can I fix this?

Well, that was odd. I unplugged my mouse and plugged it back in, and now it’s fine.

Were you closing tabs using the middle mouse button? If so, it may have gotten stuck in “scroll up” mode after being pressed.

No, I don’t even have an option to do that. Although I virtually always open new tabs from links using the middle button, so maybe that has something to do with it.