
I guess there’s a bug in custom dialog box. I have created a button in dialog box via custom script named “Send” on clicking the button its doing its task but also working when clicking away from the button (in same horizontal line).

I guess there’s a bug in custom dialog box. I have created a button in dialog box via custom script named “Send” on clicking the button its doing its task but also working when clicking away from the button (in same horizontal line).
Tried on a new doctype too.
Here’s the code:
cur_frm.cscript.button=function(frm,cdt,cdn){
var dialog = new frappe.ui.Dialog({
fields: [
{"fieldtype": "Button", "label":"Click Me", "fieldname": "butn"}
]
});
$("[data-fieldname=butn]").on('click',function(){
console.log('button pressed');
});
dialog.show();
}