mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Fix visibility and disable variables naming conventions
This commit is contained in:
parent
13c2e4485d
commit
50711e9600
1 changed files with 11 additions and 2 deletions
|
|
@ -236,8 +236,6 @@ export const TextInput = function TextInput({
|
|||
value: properties.value,
|
||||
isMandatory: isMandatory,
|
||||
isLoading: loading,
|
||||
isVisible: visibility,
|
||||
isDisabled: disable,
|
||||
};
|
||||
|
||||
setExposedVariables(exposedVariables);
|
||||
|
|
@ -245,6 +243,17 @@ export const TextInput = function TextInput({
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// Fix for "visibility is not defined" in production because there's a naming conflict in the code.
|
||||
// The issue is in the exposedVariables object where we had both a function named visibility and a property isVisible that depends on the state variable with the same name.
|
||||
const exposedVariables = {
|
||||
isVisible: visibility,
|
||||
isDisabled: disable,
|
||||
};
|
||||
setExposedVariables(exposedVariables);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const setInputValue = (value) => {
|
||||
setValue(value);
|
||||
setExposedVariable('value', value);
|
||||
|
|
|
|||
Loading…
Reference in a new issue