From f972bb320b6858debc7fadc622ebaa84334b3ecb Mon Sep 17 00:00:00 2001 From: Bhavesh Maheshwari <34086262+bhavesh95863@users.noreply.github.com> Date: Thu, 7 Jul 2022 12:19:23 +0530 Subject: [PATCH] fix: phone field type hidden property break form load (#17426) Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com> --- frappe/public/js/frappe/form/controls/phone.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/controls/phone.js b/frappe/public/js/frappe/form/controls/phone.js index d67b449ac8..83096f23a1 100644 --- a/frappe/public/js/frappe/form/controls/phone.js +++ b/frappe/public/js/frappe/form/controls/phone.js @@ -22,7 +22,7 @@ frappe.ui.form.ControlPhone = class ControlPhone extends frappe.ui.form.ControlD // Replaces code when selected and removes previously selected. this.country_code_picker.on_change = (country) => { if (!country) { - return this.reset_inputx(); + return this.reset_input(); } const country_code = frappe.boot.country_codes[country].code; const country_isd = frappe.boot.country_codes[country].isd; @@ -119,6 +119,7 @@ frappe.ui.form.ControlPhone = class ControlPhone extends frappe.ui.form.ControlD } reset_input() { + if (!this.$input) return; this.$input.val(""); this.$wrapper.find('.country').text(""); if (this.selected_icon.find('svg').hasClass('hide')) {