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 816 forks source link

Duplicate Error Messages During Async Validation #8993

Closed ocobble closed 3 weeks ago

ocobble commented 1 month ago

Describe the bug I'm trying to create a form that validates multiple questions using async calls to a server. My code is very similar to this example that I found on the SurveyJS website.

There's one minor issue. If multiple questions fail the validation and then any question is edited, duplicate error messages appear above each question.

Steps to reproduce

I've created an example survey here to demonstrate the issue.

  1. Submit the survey with several invalid answers.
  2. After submitting, the error messages will display as normal above the questions that are invalid.
  3. Edit any of the questions. Once you finish editing, the error messages will duplicate above the other incorrect questions.

Expected behavior The error messages should only display once.

Screenshots

Example of how my example survey looks after submitting:

SurveyJS Bug 3

This is what happens after I correct the misspelling in question 2. I only clicked out of the textbox. I didn't hit submit.

SurveyJS Bug 4
JaneSjs commented 3 weeks ago

Hello, Thank you for sharing the demo. However, let me note that it doesn't use SurveyJS vanilla JS libraries. Instead, it uses an outdated survey-jquery library and a legacy Modern theme. To fix the issue, upgrade your application to use the latest v1.12.8 and use the survey-js-ui package and a default theme: View Demo.

Please feel free to reactivate this thread if you require further assistance.

ocobble commented 3 weeks ago

Thank you for responding. In your demo that you linked, I still get the same error.

Survey JS Error

My React application uses survey-core and survey-react-ui version 1.12.1 and has the same issue as well.