Sidemenu outside click close

I’m trying to implement a “close on outside click” behavior for a side menu, similar to how modals work.

So far, the only way I’ve managed to achieve this is by enabling a transparent backdrop and using workflows to update a variable (isSideMenuOpen) when the backdrop is clicked. This variable controls whether the side menu is open or not, and when it’s true, the backdrop is visible.

The issue is that it doesn’t behave like a true “click outside” interaction—like with modals—where clicking outside both closes the modal and allows you to interact with whatever you clicked. In my current setup, the first click just closes the side menu, and I need a second click to actually interact with the element underneath. This results in a poor user experience.