fix: update onChange handlers in TypeInput component to use correct value references

This commit is contained in:
faisolavolut 2025-08-07 14:00:20 +07:00
parent dcc03fc676
commit 5ee748d5d7
1 changed files with 7 additions and 7 deletions

View File

@ -113,7 +113,7 @@ export const TypeInput: React.FC<any> = ({
fm.render(); fm.render();
if (typeof onChange === "function") { if (typeof onChange === "function") {
onChange(fm.data[name]); onChange(ev.currentTarget.value);
} }
}} }}
/> />
@ -140,7 +140,7 @@ export const TypeInput: React.FC<any> = ({
fm.data[name] = value; fm.data[name] = value;
fm.render(); fm.render();
if (typeof onChange === "function") { if (typeof onChange === "function") {
onChange(fm.data[name]); onChange(value);
} }
}} }}
/> />
@ -163,7 +163,7 @@ export const TypeInput: React.FC<any> = ({
fm.data[name] = getNumber(e); fm.data[name] = getNumber(e);
fm.render(); fm.render();
if (typeof onChange === "function") { if (typeof onChange === "function") {
onChange(fm.data[name]); onChange(getNumber(e));
} }
}} }}
/> />
@ -180,7 +180,7 @@ export const TypeInput: React.FC<any> = ({
fm.data[name] = val; fm.data[name] = val;
fm.render(); fm.render();
if (typeof onChange === "function") { if (typeof onChange === "function") {
onChange(fm.data[name]); onChange(val);
} }
}} }}
onOpen={() => { onOpen={() => {
@ -237,7 +237,7 @@ export const TypeInput: React.FC<any> = ({
: null; : null;
fm.render(); fm.render();
if (typeof onChange === "function") { if (typeof onChange === "function") {
onChange(fm.data[name]); onChange(value?.startDate ? new Date(value?.startDate) : null);
} }
}} }}
/> />
@ -290,7 +290,7 @@ export const TypeInput: React.FC<any> = ({
); );
fm.render(); fm.render();
if (typeof onChange === "function") { if (typeof onChange === "function") {
onChange(fm.data[name]); onChange(convertionCurrencyNumber(formatCurrency(rawValue)));
} }
input.value = formatCurrency(fm.data[name]); input.value = formatCurrency(fm.data[name]);
input.render(); input.render();
@ -340,7 +340,7 @@ export const TypeInput: React.FC<any> = ({
fm.data[name] = ev.currentTarget.value; fm.data[name] = ev.currentTarget.value;
fm.render(); fm.render();
if (typeof onChange === "function") { if (typeof onChange === "function") {
onChange(fm.data[name]); onChange(ev.currentTarget.value);
} }
}} }}
/> />