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.21k stars 814 forks source link

Progress buttons do not adhere to set CheckErrorsMode #2608

Closed Lionqueen94 closed 3 years ago

Lionqueen94 commented 3 years ago

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

Reporting 2 bugs and asking a question

What is the current behavior?

  1. With "checkErrorsMode": "onComplete", navigating via the progress buttons validates each page.
  2. Using "showProgressBar": "hidden" together with "progressBarType": "buttons" does not work, the whole survey is then hidden. This does work when I reset to `"progressBarType": "pages".

Also, clicking another page via the progress buttons does not trigger onPartialSend, is this intended? I send data to the backend on each Next click, I would like this to happen as well in case you navigate forward with the progress buttons.

What is the expected behavior?

  1. With "checkErrorsMode": "onComplete", navigating via the progress buttons should not validate each page.
  2. Using "showProgressBar": "hidden" together with "progressBarType": "buttons" should just render the survey with hidden progress buttons, just as it does with `"progressBarType": "pages".

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

Try to navigate to the second page without answering the required question via the progress buttons vs via the Next button in this Plunker: https://plnkr.co/edit/EwobXA46C8GB5g8v

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

See Plunker above

Specify your

gologames commented 3 years ago

Hello,

We fixed bug with checkErrorsMode equals "onComplete" in progress buttons case via commit above. And we can't reproduce the issue with progressBarType equals "buttons" and showProgressBar equals "hidden". Here live sample of this setup and all works fine in our case. Does it work for you?

image

Thanks, Alex SurveyJS Team

Lionqueen94 commented 3 years ago

Hi @gologames ! Thanks for your reply and the fix. For me the hidden survey happens when I have these settings:

"showProgressBar": "hidden",
"progressBarType": "buttons",
"mode": "display",
"isSinglePage": true

But I can't for the life of me seem to replicate it in a Plunker :( I do quite a bit of editing in Javascript, so it's difficult to pinpoint the issue. But what I can say is that I do see the survey when I do not have "isSinglePage": true set.

Do you have an answer to my question as to if onPartialSend should be triggered on navigating via the buttons?

gologames commented 3 years ago

Hello,

We discussed with team and implemented calling onPartialSend event via progress buttons too by the commit above. We'll check isSinglePage mode and write back to this thread immediately

Thanks, Alex SurveyJS Team

Lionqueen94 commented 3 years ago

Awesome, great to hear! I'm excited to try it out when it's released :+1: I hope you can replicate the issue, for me it's not a big problem, since it does work with "progressBarType": "pages" and I hide the progress bar on my read only page anyway. So with the bugs fixed I'm happy to release my progress bar change to production soon. Great work y'all!

gologames commented 3 years ago

Hello,

We usually release new version every Tuesday. So, you can wait this changes on next week with 1.8.25 version. Use our Whats New page to track the new releases. We'll update this thread after investigating isSinglePage mode case

Thanks, Alex SurveyJS Team

gologames commented 3 years ago

Hello,

We tried, but we also can't reproduce hiding survey issue which you had described above. Here is live sample in plunker with SurveyJSON setup which you had provided image

Good news is that for some reasons we already released new 1.8.25 version. I've updated your first live sample and all works fine now, you can check image

Thanks, Alex SurveyJS Team

Lionqueen94 commented 3 years ago

Yes I have tried to reproduce it on Plunker but I couldn't. I don't see any errors either, and the whole survey is actually present in the DOM, it is just hidden somehow, since I don't see anything. Super weird. I have tested v1.8.25 and it indeed works perfectly, thanks a lot! And have a nice weekend to you all!

gologames commented 3 years ago

Hello,

Great! I close this issue so as we can't reproduce any problems. Feel free to create another issue if you will face with any troubles

Thanks, Alex SurveyJS Team

Lionqueen94 commented 3 years ago

Hi there!

Sorry to bother you again, but I have found 2 more issues with "progressBarType": "buttons". When onServerValidateQuestions is implemented (with setting "checkErrorsMode": "onValueChanged" for example or at least not on "onComplete":

  1. The passed progressNavigationButtons do not get the class sv_progress-buttons__list-element--passed.
  2. When you are on the 1st page and click on the 3rd page, surveyjs sends you to the 2nd page.

I have been able to reproduce it in this Plunker: https://plnkr.co/edit/lJLvVsRbuBDvK21V

As you can see in the above Plunker:

  1. When you go to a next page, the class is not applied to the buttons of the previous pages.
  2. Click on the Contacts page when you are on the Satisfaction page and see that you end up on the Pricing page instead of the Contacts page.

P.S. @gologames If you want me to create a new issue, I will, just let me know :+1:

gologames commented 3 years ago

I've created separate issue and will update it after investigation