diff --git a/frappe/public/js/frappe/form/controls/int.js b/frappe/public/js/frappe/form/controls/int.js index ce2336bb82..12652bf86e 100644 --- a/frappe/public/js/frappe/form/controls/int.js +++ b/frappe/public/js/frappe/form/controls/int.js @@ -8,6 +8,17 @@ frappe.ui.form.ControlInt = class ControlInt extends frappe.ui.form.ControlData make_input () { var me = this; super.make_input(); + this.$input + // .addClass("text-right") + .on("focus", function () { + setTimeout(function () { + if (!document.activeElement) return; + document.activeElement.value + = me.validate(document.activeElement.value); + document.activeElement.select(); + }, 100); + return false; + }); } validate (value) { return this.parse(value);