mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-02-09 06:58:41 -06:00
Fixed a bug in the InputDialog.jsx
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user