Hi Michal,
The plugin does not know the contents of the widget box are. I see you have a form here. You can check with the form plugin author and see if there is an option to call the function above as in the docs.
I would suggest the JS code below from my side.
<script>
document.addEventListener('DOMContentLoaded', function() {
const wpcf7Form = document.querySelector('.wpcf7-form');
if (wpcf7Form) {
wpcf7Form.addEventListener('submit', function(event) {
UFW.close(1);
});
}
});
</script>
Please paste this JS code snippet in your website.
Thanks,
Aakash