We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e24acc commit 34f3188Copy full SHA for 34f3188
src/SimpleInput/index.js
@@ -21,8 +21,8 @@ const SimpleInput = ({
21
max,
22
ns,
23
children,
24
- decimalSeparator = ",",
25
- thousandSeparator = ".",
+ decimalSeparator = ".",
+ thousandSeparator = "'",
26
}) => {
27
const [isvalid, setisvalid] = useState();
28
const [localValue, setlocalValue] = useState("");
@@ -72,9 +72,10 @@ const SimpleInput = ({
72
value = value.replace(regex, "");
73
console.log(value);
74
if (thousandSeparator === ".") value = value.replace(/\./g, "");
75
+ if (thousandSeparator === ",") value = value.replace(/,/g, "");
76
+ if (thousandSeparator === "'") value = value.replace(/'/g, "");
77
console.log(value, Number(value));
78
- if (thousandSeparator === ",") value = value.replace(/,/g, "");
79
value = value.replace(/ %/g, "");
80
updated[event.target.name] = Number(value) || value;
81
} else if (value && type === "percent1") {
src/SimpleInput/partials/InputTag/index.js
@@ -11,10 +11,11 @@ const InputTag = ({
11
autoFocus,
12
currency,
13
inputRef,
14
15
16
17
const onNumericValueChange = (e) => {
18
+ console.log(e.target.value);
19
if (e.target.value !== value) {
20
onChange(e);
}
@@ -36,7 +37,7 @@ const InputTag = ({
36
37
suffix={suffix}
38
name={name}
39
readOnly={readonly}
- onChange={onChange}
40
+ onChange={onNumericValueChange}
41
autoFocus={autoFocus}
42
/>
43
);
0 commit comments