Fixed a bug in the InputDialog.jsx

This commit is contained in:
Mathias Wagner
2023-02-19 20:48:35 +01:00
parent 09dc2650f5
commit 7933e420d5

View File

@@ -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") {