mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
fix(web/input): properly reset from when using closeInputDialog
This commit is contained in:
@@ -66,15 +66,14 @@ const InputDialog: React.FC = () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
useNuiEvent('closeInputDialog', () => {
|
useNuiEvent('closeInputDialog', async () => await handleClose(true));
|
||||||
setVisible(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleClose = async () => {
|
const handleClose = async (dontPost?: boolean) => {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||||
form.reset();
|
form.reset();
|
||||||
fieldForm.remove();
|
fieldForm.remove();
|
||||||
|
if (dontPost) return;
|
||||||
fetchNui('inputData');
|
fetchNui('inputData');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user