From dd63ab9d9e798835d9a03252c984f08a6fcb3b8f Mon Sep 17 00:00:00 2001 From: WFHP <209218753+wfhp@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:57:45 +0800 Subject: [PATCH] fix: use `inputmode="decimal"` for Float, Currency, and Percent fields ControlFloat inherits from ControlInt, which sets `inputmode="numeric"`. On mobile devices, this brings up a numeric keypad without a decimal point, making it impossible to enter decimal values (e.g. 0.16, 0.18) for Float, Currency, and Percent fields. Fix: Override `input_mode` to `"decimal"` in ControlFloat. Per the HTML spec, `inputmode="decimal"` instructs mobile browsers to display a numeric keypad that includes a decimal separator. Since ControlCurrency and ControlPercent both extend ControlFloat, they automatically inherit the fix. --- frappe/public/js/frappe/form/controls/float.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/public/js/frappe/form/controls/float.js b/frappe/public/js/frappe/form/controls/float.js index 8a0e527c3b..5a6ac5d9d6 100644 --- a/frappe/public/js/frappe/form/controls/float.js +++ b/frappe/public/js/frappe/form/controls/float.js @@ -1,4 +1,5 @@ frappe.ui.form.ControlFloat = class ControlFloat extends frappe.ui.form.ControlInt { + static input_mode = "decimal"; parse(value) { value = this.eval_expression(value); return isNaN(parseFloat(value)) ? null : flt(value, this.get_precision());