From 09e76de3ee4acaffed352ed2a522f99eae754b08 Mon Sep 17 00:00:00 2001
From: Jandson Vitorino <101944851+jandsonrj@users.noreply.github.com>
Date: Wed, 16 Aug 2023 15:26:50 -0300
Subject: [PATCH] added trim on input value (#182)
---
frontend/components/newProduct/Step3.js | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/frontend/components/newProduct/Step3.js b/frontend/components/newProduct/Step3.js
index 001c4b4..927d551 100644
--- a/frontend/components/newProduct/Step3.js
+++ b/frontend/components/newProduct/Step3.js
@@ -58,14 +58,14 @@ export function InputReadOnly({ name, value, onClear }) {
InputProps={
onClear !== undefined
? {
- endAdornment: (
-
-
-
-
-
- )
- }
+ endAdornment: (
+
+
+
+
+
+ )
+ }
: null
}
/>
@@ -124,8 +124,11 @@ export function InputAlias({ pc, onChange, onChangeInputType }) {
)
const handleChange = e => {
- setValue(e.target.value)
- delayedEdit(pc, e.target.value)
+ const inputValue = e.target.value
+ if (inputValue.trim() !== '') {
+ setValue(inputValue)
+ delayedEdit(pc, inputValue)
+ }
}
const handleClear = () => {