Collapsed menus expanding alone

Hello guys!

I’ve been avoiding this for a while, but it bothers me so much that I gave up. The UI menus I collapse, expand as soon as I click anywhere in the editor, I can ignore it for a while, but when the project starts getting more complex, things get frustrating really fast.
I don’t know where to post this question, but I’d be happy if anyone could tell me what to do.

This short video shows the problem:

Thank you.