From 16be2bc9bdee73d4016b277fcafcecb61b09b106 Mon Sep 17 00:00:00 2001 From: Chiel Wester Date: Fri, 30 Oct 2020 15:51:00 +0100 Subject: [PATCH] feat: add interaction/trigger to auto submit form --- src/components/form.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/form.js b/src/components/form.js index 61938ff54..64dd1d527 100644 --- a/src/components/form.js +++ b/src/components/form.js @@ -45,6 +45,13 @@ const mounted = useRef(false); + useEffect(() => { + B.defineFunction('Submit', () => { + formRef.current.dispatchEvent(new Event('submit')); + }); + B.triggerEvent('onComponentLoad'); + }, []); + useEffect(() => { mounted.current = true; return () => {