Collapse all the other sidebar widgets when I click to expand one of them

Hi everyone,

I want to ask if there is currently a way to collapse all sidebar widgets when I click to expand one of them, so that only one is expanded and visible/usable at any time.

Thanks in advance!