An event after survey validate the questions on the current page is missed
See original GitHub issueAre you requesting a feature, reporting a bug or asking a question?
I’m reporting a bug.
What is the current behavior?
Accessing surveyModel.isCurrentPageHasErrors
will cause onErrorCustomText
events to be fired for each error on the page.
What is the expected behavior?
The documentation says that isCurrentPageHasErrors
is a readonly property. I would expect that accessing a property doesn’t fire events, potentially triggering side-effects that I’ve added to these events.
How would you reproduce the current behavior (if this is a bug)?
Add a console.log
to onErrorCustomText
and then access isCurrentPageHasErrors
from any event such as onAfterRenderSurvey
.
Provide the test code and the tested page URL (if applicable)
Run the below code and open the console.
If there are two questions on the first page of the survey, onErrorCustomText
will fire twice.
Test code
import React from 'react';
import { Model, Survey } from 'survey-react';
import { mockData } from '../lib/mockData';
export class SurveyTest extends React.Component {
public render() {
return <Survey
json={mockData}
onErrorCustomText={this.onErrorCustomText}
onAfterRenderSurvey={this.onAfterRenderSurvey}
/>
}
private onErrorCustomText = () => {
console.log('onErrorCustomText');
};
private onAfterRenderSurvey = (s: typeof Model) => {
s.isCurrentPageHasErrors;
}
}
Specify your
- browser: Chrome
- browser version: 73.0.3683.103 (Official Build) (64-bit)
- surveyjs platform (angular or react or jquery or knockout or vue): react
- surveyjs version: 1.0.78
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Response Requirements & Validation - Qualtrics
Response requirements & validation are used to alert respondents about questions they may have missed, or they can be used to solicit a...
Read more >Post-Event Survey Questions for Your Next ... - SurveyMonkey
Check out this entertainment event feedback survey template to help you find questions that may improve presentations and performances for your next event....
Read more >Standards and Guidelines for Statistical Surveys - SAMHSA
Within this framework, the 20 standards and their related guidelines for Federal statistical surveys focus on ensuring high quality statistical surveys that ...
Read more >Question validation in surveys - QuestionPro
Question validation can also let the survey administrators configure the study to request the participants to respond if they missed it.
Read more >Surveys | University of North Dakota
From the Projects page, open the Survey tab in any one of three ways: ... The following validation types are available for all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zhihil I have a new event, onValidatedErrorsOnCurrentPage. It fires after question validation on the current page. You may look at my unit test to find out how it works.
It will be available in the next minor update, that we will release on the next week. You may build the library from source. The instruction for building library from source in the Readme file.
Let me know if it works.
Thank you, Andrew
Great!