fix: phone field type hidden property break form load (#17426)

Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com>
This commit is contained in:
Bhavesh Maheshwari 2022-07-07 12:19:23 +05:30 committed by GitHub
parent 010a436569
commit f972bb320b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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