react-typeform-embed icon indicating copy to clipboard operation
react-typeform-embed copied to clipboard

onSubmit function for multiple typeform on one page

Open pradeepgill007 opened this issue 7 years ago • 5 comments
trafficstars

I am embedding 2 typeform in a single component. onSubmit function on both the component get called simultaneously even if I have submitted only first typeform.

import React from "react";
import { ReactTypeformEmbed } from "../components";

const ExampleWidget = () => {
  return (
    <div>
      <div>
        <ReactTypeformEmbed
          onSubmit={() => {
            console.log("typeform 1 submitted");
          }}
          url={"https://typeformdeviomedia.typeform.com/to/Cvc6N8"}
        />
      </div>
      <div>
        <ReactTypeformEmbed
          onSubmit={() => {
            console.log("typeform 2 submitted");
          }}
          url={"https://admin.typeform.com/to/cVa5IG"}
        />
      </div>
    </div>
  );
};

export default ExampleWidget;

pradeepgill007 avatar Nov 13 '18 14:11 pradeepgill007

Same Issue here.

Ivaylo-Bachvarov avatar Nov 30 '19 15:11 Ivaylo-Bachvarov

Any update or workarounds on this issue?

bekkblando avatar Dec 12 '19 23:12 bekkblando

I had a similar issue with only one form on the page. Everything was fine on the first submit, but onSubmit was fired twice on the next form submit, and three times on the next and so on.

catob avatar Jun 16 '20 12:06 catob

I had a similar issue with only one form on the page. Everything was fine on the first submit, but onSubmit was fired twice on the next form submit, and three times on the next and so on.

Did you found workaround? Currently stuck with the same issue.

EDIT: Issue dissapeared by replacing this react wrapper with official @typeform/embeded package!

InnProgress avatar Jul 19 '20 12:07 InnProgress

I had a similar issue with only one form on the page. Everything was fine on the first submit, but onSubmit was fired twice on the next form submit, and three times on the next and so on.

Did you found workaround? Currently stuck with the same issue.

EDIT: Issue dissapeared by replacing this react wrapper with official @typeform/embeded package!

I did not. I ended up using the official typeform package as well.

catob avatar Jul 20 '20 08:07 catob