Render modal from theme client-side plugin API

Hi,
I’m showing a modal when we open a forum. Is there a simple way to prevent the modal from closing when we click outside?