From ccb31e7b0fbf5f71ac2aedd20184909565f946b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 20 Aug 2018 22:40:47 +0200 Subject: [PATCH] Set step to 'any' when there is no digits issue7618 review47661002 --- src/view/form.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/view/form.js b/src/view/form.js index 0231e5608c..352f0d652d 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -1687,16 +1687,17 @@ function eval_pyson(value){ Sao.View.Form.Float = Sao.class_(Sao.View.Form.Integer, { class_: 'form-float', display: function(record, field) { - var digits = 'any'; + var step = 'any'; if (record) { - digits = field.digits(record, this.factor); + var digits = field.digits(record, this.factor); if (digits) { - digits = digits[1]; - } else { - digits = 'any'; + step = digits[1]; } } - this.input.attr('step', Math.pow(10, -digits)); + if (step !== 'any') { + step = Math.pow(10, -step); + } + this.input.attr('step', step); Sao.View.Form.Float._super.display.call(this, record, field); } });