Suggestion T10557
Visible to All Users

Re: Is there a duplicate/onDuplicate event handler?

created 2 years ago

The problem we are encountering is that we can't differenciate whether any question was added via the toolbar, duplicate button, or changing the type when using the onQuestionAdded function. We attempted to do the same thing with no avail with the onModified function but couldn't differenciate between whether a the page was duplicated or an existing question dragged onto a new page.

Answers approved by surveyjs Support

created 2 years ago

Hello Tyler,
I understood the scenario. I will make sure that we update our API to perform this task. We will be back on this issue.

Thank you,
Andrew
SurveyJS Team

    Comments (1)

      Hello Tyler,
      We have added a new option into options parameter:
      options.reason. It could have values: "ADDED_FROM_TOOLBOX", "ADDED_FROM_PAGEBUTTON", "ELEMENT_COPIED"
      Here is the related issue on GitHub. You can review my unit test in the related PR.
      The new functionality will be available in new minor version 1.9.49 that we will release next week.

      Thank you,
      Andrew
      SurveyJS Team