diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index 245ea93f0..f50626e15 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -5,6 +5,7 @@ import { TabsContext } from "../../contexts/tabsContext"; import _ from "lodash"; import { INPUT_STYLE } from "../../constants"; import { X, Plus } from "lucide-react"; +import { PopUpContext } from "../../contexts/popUpContext"; export default function InputListComponent({ value, @@ -13,6 +14,8 @@ export default function InputListComponent({ editNode = false, }: InputListComponentType) { const [inputList, setInputList] = useState(value ?? [""]); + const { closePopUp } = useContext(PopUpContext); + useEffect(() => { if (disabled) { setInputList([""]); @@ -22,8 +25,10 @@ export default function InputListComponent({ useEffect(() => { setInputList(value); - }, [value]); + }, [closePopUp]); + + return (