diff --git a/frappe/public/js/frappe/form/controls/base_input.js b/frappe/public/js/frappe/form/controls/base_input.js index ba4b2bd0d3..3cd277a239 100644 --- a/frappe/public/js/frappe/form/controls/base_input.js +++ b/frappe/public/js/frappe/form/controls/base_input.js @@ -179,8 +179,11 @@ frappe.ui.form.ControlInput = class ControlInput extends frappe.ui.form.Control // This is used to display formatted output AND showing values in read only fields if (this.disp_area) { $(this.disp_area).html(display_value); - // Apply alignment for supported fields - if (this.df.alignment && ["Data", "Int", "Float", "Currency", "Percent"].includes(this.df.fieldtype)) { + // Apply alignment only for supported fields + if ( + this.df.alignment && + ["Data", "Int", "Float", "Currency", "Percent"].includes(this.df.fieldtype) + ) { $(this.disp_area).css("text-align", this.df.alignment.toLowerCase()); } } diff --git a/frappe/public/js/frappe/form/controls/data.js b/frappe/public/js/frappe/form/controls/data.js index 5bb401a92c..dcaf1cab44 100644 --- a/frappe/public/js/frappe/form/controls/data.js +++ b/frappe/public/js/frappe/form/controls/data.js @@ -251,8 +251,11 @@ frappe.ui.form.ControlData = class ControlData extends frappe.ui.form.ControlInp if (this.df.input_class) { this.$input.addClass(this.df.input_class); } - // Apply alignment if specified for supported field types - if (this.df.alignment && ["Data", "Int", "Float", "Currency", "Percent"].includes(this.df.fieldtype)) { + // Apply alignment for supported field types + if ( + this.df.alignment && + ["Data", "Int", "Float", "Currency", "Percent"].includes(this.df.fieldtype) + ) { this.$input.css("text-align", this.df.alignment.toLowerCase()); } }