Merge main back to develop (#9864)

* fix : form csa for onsubmit not getting triggered (#9862)

* Bump version to v2.50.0 (#9863)

---------

Co-authored-by: Kiran Ashok <stepinfwd@gmail.com>
This commit is contained in:
Sherfin Shamsudeen 2024-05-24 21:40:46 +05:30 committed by GitHub
parent 879201fb1f
commit f2ed28f6d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 16 deletions

View file

@ -1 +1 @@
2.45.0
2.50.0

View file

@ -1 +1 @@
2.45.0
2.50.0

View file

@ -66,19 +66,16 @@ export const Form = function Form(props) {
const mounted = useMounted();
useEffect(() => {
const exposedVariables = {
resetForm: async function () {
resetComponent();
},
submitForm: async function () {
if (isValid) {
onEvent('onSubmit', formEvents).then(() => resetComponent());
} else {
fireEvent('onInvalid');
}
},
};
setExposedVariables(exposedVariables);
setExposedVariable('resetForm', async function () {
resetComponent();
});
setExposedVariable('submitForm', async function () {
if (isValid) {
onEvent('onSubmit', formEvents).then(() => resetComponent());
} else {
fireEvent('onInvalid');
}
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

View file

@ -1 +1 @@
2.45.0
2.50.0