surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.23k stars 821 forks source link

Upload Files Trigger #7907

Open Grubiopa opened 9 months ago

Grubiopa commented 9 months ago

Are you requesting a feature, reporting a bug or asking a question?

It's a bug that occurs in versions 1.9 - We upload to survey-vue: 1.9.132

Last previous version tested that works: 1.8.29

What is the current behavior?

The survey.onUploadFiles.add is not trigger when a file need to be upload

image

And no logs are shown.

What is the expected behavior?

Trigger the method onUploadFiles

How would you reproduce the current behavior (if this is a bug)?

Trying to upload files with version 1.8.29 and later upgrading the version

Provide the test code and the tested page URL (if applicable)

Test code

this.survey.onUploadFiles.add((survey, options) => { console.log("Entra al onuploadfiles"); const promises: Promise[] = []; options.files.forEach(file => { const p = this.$vlf.setItem(${options.name}/${file.name}, file); promises.push(); });

  Promise.all(promises).then(() => {
    setTimeout(this.setVisivilityOfNoChosenFileLabel, 100);
    options.callback(
      'success',
      options.files.map(file => {
        return { file, content: `${options.name}/${file.name}` };
      })
    );
  });
});
---------------------------
json
-------

{ "type": "file", "name": "Create and Upload the HLD for the Data Source onboarding here", "isRequired": true, "storeDataAsText": false, "maxSize": 0 }

Specify your

Grubiopa commented 9 months ago

The vue version is "vue": "^2.6.14",

tsv2013 commented 8 months ago

Can you share a minimal live example illustrating the issue?

JaneSjs commented 8 months ago

Hello @Grubiopa, I just tested the File Upload (Vue) demo on my end and didn't get any issues. The survey.onUploadFiles event was correctly invoked.

If you require further assistance, please send us a problematic demo for research.

Thanks

Grubiopa commented 8 months ago

https://github.com/surveyjs/survey-library/assets/14932026/011e18ad-7d3a-4b55-a70a-fab9f8c58cae

Grubiopa commented 8 months ago

while is not seeing is the selection of the file