Skip to content

Commit

Permalink
feat: add interaction/trigger to auto submit form
Browse files Browse the repository at this point in the history
  • Loading branch information
chielwester committed Oct 30, 2020
1 parent 0820030 commit 16be2bc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 16be2bc

Please sign in to comment.