mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Fixed value of value CSA when no default value is set and clear() action is used. (#11409)
This commit is contained in:
parent
c3b14dac27
commit
05b25cfe82
4 changed files with 9 additions and 4 deletions
|
|
@ -236,7 +236,7 @@ export const numberinputConfig = {
|
|||
},
|
||||
],
|
||||
exposedVariables: {
|
||||
value: 99,
|
||||
value: 0,
|
||||
isMandatory: false,
|
||||
isVisible: true,
|
||||
isDisabled: false,
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ export const NumberInput = function NumberInput({
|
|||
|
||||
useEffect(() => {
|
||||
setInputValue(Number(parseFloat(properties.value).toFixed(properties.decimalPlaces)));
|
||||
if (isNaN(Number(parseFloat(properties.value).toFixed(properties.decimalPlaces)))) {
|
||||
setExposedVariable('value', null);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [properties.value]);
|
||||
|
||||
|
|
@ -144,6 +147,7 @@ export const NumberInput = function NumberInput({
|
|||
},
|
||||
clear: async function () {
|
||||
setInputValue('');
|
||||
setExposedVariable('value', null);
|
||||
fireEvent('onChange');
|
||||
},
|
||||
setLoading: async function (loading) {
|
||||
|
|
@ -167,7 +171,8 @@ export const NumberInput = function NumberInput({
|
|||
};
|
||||
if (!isNaN(value)) {
|
||||
exposedVariables.value = value;
|
||||
}
|
||||
} else exposedVariables.value = null;
|
||||
|
||||
setExposedVariables(exposedVariables);
|
||||
|
||||
isInitialRender.current = false;
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ export const numberinputConfig = {
|
|||
},
|
||||
],
|
||||
exposedVariables: {
|
||||
value: 99,
|
||||
value: 0,
|
||||
isMandatory: false,
|
||||
isVisible: true,
|
||||
isDisabled: false,
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ export const numberinputConfig = {
|
|||
},
|
||||
],
|
||||
exposedVariables: {
|
||||
value: 99,
|
||||
value: 0,
|
||||
isMandatory: false,
|
||||
isVisible: true,
|
||||
isDisabled: false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue