mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-18 01:58:36 +00:00
fix(web/input): properly reset from when using closeInputDialog
This commit is contained in:
1 parent
40fa45aab4
commit
9a40e6b519
1 file changed
+3
-4
@@ -66,15 +66,14 @@ const InputDialog: React.FC = () => {
|
||||
});
|
||||
});
|
||||
|
||||
useNuiEvent('closeInputDialog', () => {
|
||||
setVisible(false);
|
||||
});
|
||||
useNuiEvent('closeInputDialog', async () => await handleClose(true));
|
||||
|
||||
const handleClose = async () => {
|
||||
const handleClose = async (dontPost?: boolean) => {
|
||||
setVisible(false);
|
||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||
form.reset();
|
||||
fieldForm.remove();
|
||||
if (dontPost) return;
|
||||
fetchNui('inputData');
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user