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')) {