From c7006f47908f4a7ce1694eb64aa593dbe43caeb2 Mon Sep 17 00:00:00 2001 From: Flaminia Cavallo Date: Wed, 4 Dec 2024 13:46:43 +0100 Subject: [PATCH] fix: use nullish coalescing operatorin input field to check if value is given --- components/input/src/input-field/input-field.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/components/input/src/input-field/input-field.js b/components/input/src/input-field/input-field.js index 169e7773a..6eba9d99e 100644 --- a/components/input/src/input-field/input-field.js +++ b/components/input/src/input-field/input-field.js @@ -66,13 +66,7 @@ class InputField extends React.Component { onChange={onChange} name={name} type={type} - value={ - value === null || - value === undefined || - Number.isNaN(value) - ? '' - : value - } + value={value ?? ''} placeholder={placeholder} disabled={disabled} max={max}