mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
fixing app freeze issue while giving empty array as default value (#2515)
This commit is contained in:
parent
1d67752aca
commit
4429cde723
1 changed files with 8 additions and 3 deletions
|
|
@ -43,13 +43,18 @@ export const DropDown = function DropDown({
|
|||
|
||||
useEffect(() => {
|
||||
let newValue = undefined;
|
||||
if (values?.includes(value)) newValue = value;
|
||||
|
||||
if (values?.includes(value)) {
|
||||
newValue = value;
|
||||
}
|
||||
setCurrentValue(newValue);
|
||||
setExposedVariable('value', newValue);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [value]);
|
||||
|
||||
useEffect(() => {
|
||||
setExposedVariable('value', currentValue);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [currentValue]);
|
||||
|
||||
useEffect(() => {
|
||||
let newValue = undefined;
|
||||
if (values?.includes(currentValue)) newValue = currentValue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue