From b7c2e7254efd9075f1c74b84ae2a86c12b0bd35e Mon Sep 17 00:00:00 2001 From: Flaminia Cavallo Date: Wed, 4 Dec 2024 11:49:50 +0100 Subject: [PATCH] fix: allow zero as a value for input field --- components/input/src/input-field/input-field.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/input/src/input-field/input-field.js b/components/input/src/input-field/input-field.js index d9275dca1..169e7773a 100644 --- a/components/input/src/input-field/input-field.js +++ b/components/input/src/input-field/input-field.js @@ -66,7 +66,13 @@ class InputField extends React.Component { onChange={onChange} name={name} type={type} - value={value || ''} + value={ + value === null || + value === undefined || + Number.isNaN(value) + ? '' + : value + } placeholder={placeholder} disabled={disabled} max={max}