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.11k stars 801 forks source link

An error occurs when submitting a survey with a Signature Pad question specified and then hidden by a condition #8741

Closed ninjamon23 closed 3 weeks ago

ninjamon23 commented 1 month ago

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

Bug

What is the current behavior?

Unable to complete the forms. Error is shown that it was a not able to clear the values of the signature pad image

What is the expected behavior?

Able to complete the forms

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

  1. Create a form with a signature pads with conditions to show or hide based on a certain field
  2. When viewing and signing the form( using survey-vue3-ui) update the value of the certain field that will show or hide signature pads
  3. Click submit/complete and error will be shown

Workaround we have found

We disabled the clearInvisibleValues property to fix the issue and continue the forms

Specify your

JaneSjs commented 3 weeks ago

Hello, Thank you for reporting this issue. I reproduced it on my end: View Demo. To reproduce the issue, set Yes, put a signature, and click No. Submit the survey. The following issue occurs:

Uncaught TypeError: Cannot read properties of null (reading 'clear')
    at t.refreshCanvas (survey.core.min.js:11:14499)
    at t.clearValue (survey.core.min.js:11:19954)
    at t.clearValueIfInvisibleCore (survey.core.min.js:6:333746)
    at t.clearValueIfInvisible (survey.core.min.js:6:333625)
    at t.clearInvisibleQuestionValues (survey.core.min.js:6:828003)
    at t.clearUnusedValues (survey.core.min.js:6:827460)
    at t.doComplete (survey.core.min.js:6:792375)
    at t.doCurrentPageCompleteCore (survey.core.min.js:6:784634)
    at t.doCurrentPageComplete (survey.core.min.js:6:784482)
    at t.completeLastPage (survey.core.min.js:6:783258)

We will research this issue and update you shortly.