Autoclose on click outside modal


How can i automatically close a modal when i click outside of it? I dont want to use a close button but instead a click trigger outside the modal. I tried doing on the body element but it does trigger when opening them odal which is not what i want.


hey @pagios Have a look here;

Works well. You may also want to go through the topic below for a more advanced setup.

Hi @pagios!
I solved the problem by putting the Modal Window div outside the Modal Wrapper div with an higher z-index.
Then the trigger click on the Modal Wrapper to transform itself and the Modal Window to their original settings.