Issue with dialog box button

Screenshot_2018-08-21%20New%20R%20App%201

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).

1 Like

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();
}