mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +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', () => {
|
||||
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