From 7933e420d5f6629bb808ebc503594b836b125192 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 19 Feb 2023 20:48:35 +0100 Subject: [PATCH] Fixed a bug in the InputDialog.jsx --- client/src/common/contexts/InputDialog/InputDialog.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/common/contexts/InputDialog/InputDialog.jsx b/client/src/common/contexts/InputDialog/InputDialog.jsx index 2082c89c..2eac9647 100644 --- a/client/src/common/contexts/InputDialog/InputDialog.jsx +++ b/client/src/common/contexts/InputDialog/InputDialog.jsx @@ -9,7 +9,11 @@ export const InputDialogContext = createContext({}); const DialogArea = ({dialog}) => { const close = useContext(DialogContext); - const [value, setValue] = useState(dialog.value || ""); + const [value, setValue] = useState(""); + + useEffect(() => { + if (dialog.value) setValue(dialog.value); + }, [dialog.value]); document.onkeyup = e => { if (e.key === "Enter") {