Click-away behavior for side panels

I would like to be able to leave the side panel view once I click outside it (click-away behavior).