frappe.ui.Dialog closing when click outside modal

Hi All
I have created a custom dialog, var dialog = frappe.ui.Dialog. How can I stop it from closing when user clicks outside modal?

That is the default behavior of any pop up. Why do you want to change it?

Thanks Kanchan for the reply. This is a custom dialog as per instructions form the Developer guide so I think changing behaviour is part of the customisation.
I use it to display a table of customer profile as a pop up.

@CoffeeHolic I have same requirement, Did you find a way to do it?

After pop up appears,
$(‘.modal-backdrop’).unbind(‘click’);
works for me.

3 Likes

I agree with @Nitto, Just as an add-on, you can use this to hide both the backdrop and the modal.

$(‘.modal-backdrop’).hide();
$(‘.modal-dialog’).hide();