From 16e878fb693175e1a4059465ee35a01a3d8334ef Mon Sep 17 00:00:00 2001 From: Samuel Pietra Date: Mon, 23 Nov 2020 17:18:42 -0300 Subject: [PATCH] adds step=any atribute in input if none was provided and input type=number --- src/forms/FormInput.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/forms/FormInput.jsx b/src/forms/FormInput.jsx index 57112ec..7b78ca0 100644 --- a/src/forms/FormInput.jsx +++ b/src/forms/FormInput.jsx @@ -25,6 +25,10 @@ export function FormInput({ type, name, required: _required, disabled: _disabled attrs.value = getValue(); } + if (type === 'number' && !_attrs.step) { + attrs.step = 'any'; + } + return ; }