最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - survey-react-ui onUploadFiles not triggering on choose file button file picked - Stack Overflow

programmeradmin8浏览0评论

I am using survey-react-ui version 1.12.27, all other events are triggering but onUploadFiles event is not triggering.

When i select file using "choose file" button event does not trigger. while drag and drop the file to the drag drop area triggers the onUploadFiles event. i tried with different versions of react and different versions of survey-react-ui, for each new project it works fine but in my project where i need it work correctly it is not working.

i tried to manually fire the model.onUploadFiles event by adding an event listener to the choose file button, but in this case i am not able to get all the call backs which are available survey-react-ui's onUploadFiles.

I am using survey-react-ui version 1.12.27, all other events are triggering but onUploadFiles event is not triggering.

When i select file using "choose file" button event does not trigger. while drag and drop the file to the drag drop area triggers the onUploadFiles event. i tried with different versions of react and different versions of survey-react-ui, for each new project it works fine but in my project where i need it work correctly it is not working.

i tried to manually fire the model.onUploadFiles event by adding an event listener to the choose file button, but in this case i am not able to get all the call backs which are available survey-react-ui's onUploadFiles.

Share Improve this question asked Mar 13 at 11:00 Abdulbasit KhaleeqAbdulbasit Khaleeq 447 bronze badges 3
  • 1 Can you please share the JSON of a your file question - this will help with the minimal reproducible sample and the JavaScript as well. For example as per the documentation: > The event applies only if storeDataAsText is false This is just a pointer, but once you share your JSON and your JavaScript, we can help pretty fast – Kung Func Commented Mar 14 at 8:55
  • "elements": [ { "type": "file", "name": "qDocument", "title": "xxxx", "allowMultiple": true, "allowImagesPreview": false, "acceptedTypes": ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, image/*, .pdf, application/msword, application/vnd.ms-powerpoint, .txt, .docx, .xlsx, .pptx", "storeDataAsText": false, "maxSize": 20971520 } ] – Abdulbasit Khaleeq Commented Mar 14 at 12:20
  • storeDataAsText is set to false. – Abdulbasit Khaleeq Commented Mar 14 at 12:21
Add a comment  | 

1 Answer 1

Reset to default -1

I figured out, latest version does not support bootstrap. when i started updating 4 years old version to 1.12.26, documentation stated that bootstrap support is obsolete, but they also provided how to apply bootstrap them. as per surveyjs documentation they update version every 2 weeks, in version 1.12.27 and 2.0.0 they removed it completely.

the issue was that they have not handled file upload case for bootstrap and that's why the event was not working.

if someone is looking to migrate or update version and using bootstrap, they have to choose one of their provided theme and you can customize that theme to match your website theme.

发布评论

评论列表(0)

  1. 暂无评论