Describe the bug
The key and value of a Text Editor field are not included in the values object in the primary_action function of a dialog.
To Reproduce
frm.add_custom_button("Test dialog", function(){
let test_dialog = new frappe.ui.Dialog({
title: 'Enter details',
fields: [
{
label: 'Text',
fieldname: 'test_txt',
fieldtype: 'Text Editor',
}
],
primary_action_label: 'Submit',
primary_action(values){
console.log(values)
test_dialog.hide()
}
})
test_dialog.show()
})
In the code above, I create a dialog with a Text Editor field with the name of test_txt. Then I type something, e.g. abcdef in the field and click Submit button.
The result is expected to be {test_txt: 'abcdef'}. But the result is {} instead.
My initial solution for getting the needed result is to use test_dialog.fields_dict.test_txt.value. But it would be better if it can be directly obtained from the values.
Please fix this issue. Thank you very much.
Desktop:
- OS: macOS.
- Browser: Chrome
- Frappe version: 14