SurveyJS v2.5.8
Released: January 27, 2026
SurveyJS v2.5.8 introduces an API to traverse the survey element tree and enhances input mask functionality. Pattern-masked fields now support custom placeholders and validation for incomplete values. Bug fixes are also included.
Input Mask Enhancements
Pattern Input Mask – Custom Placeholder
Input fields with the "pattern" mask type now support a text question’s placeholder. The placeholder text is rendered until the field receives focus or the user begins typing. Once the field is focused or a value is entered, the placeholder text is replaced by the pattern’s underscore placeholders, guiding the user to complete the masked input.
Example:
{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "text",
"name": "creditcard",
"title": "Credit card number:",
"maskType": "pattern",
"maskSettings": {
"pattern": "9999 9999 9999 9999"
},
"placeholder": "Enter your credit card number..."
}
]
}
]
}
Validation for Incomplete Masked Values
With this update, any value entered by the user is retained even if they move focus away from a partially completed pattern-masked field. To prevent users from leaving such fields incomplete, set SurveyModel.checkErrorsMode to "onValueChanged" and enable the SurveyModel.validateVisitedEmptyFields option.
{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "panel",
"name": "panel1",
"elements": [
{
"type": "text",
"name": "creditcard",
"title": "Credit card number:",
"isRequired": true,
"requiredErrorText": "You need to enter the full number",
"maskType": "pattern",
"maskSettings": {
"pattern": "9999 9999 9999 9999"
}
}
]
}
]
}
],
"checkErrorsMode": "onValueChanged",
"validateVisitedEmptyFields": true
}
API for Traversing the Survey Element Tree
This release adds the getOwner() method to all survey elements, including pages, panels, questions, choices, matrix rows, columns, and validators. The method enables upward traversal of the survey structure, allowing you to identify higher-level elements that own a given lower-level element.
One practical use case is expression validation. The following example validates survey expressions and determines whether an invalid expression belongs to a question, panel, page, or the survey itself:
// ...
// Omitted: `SurveyModel` creation
// ...
const results = survey.validateExpressions();
results.forEach(result => {
let element = result.obj;
while (
!element.isQuestion &&
!element.isPanel &&
!element.isPage &&
!element.isSurvey
) {
element = element.getOwner();
}
const elementName = element.name || "survey";
// Example: log validation errors
console.warn(
`Expression error in "${elementName}", property "${result.propertyName}":`,
result.errors
);
});
This API provides a consistent and reliable way to navigate from any survey element to its owning container, simplifying diagnostics and tooling for complex survey configurations.
Bug Fixes and Minor Enhancements
Form Library
- Dynamic Panel:
validateExpressions()reports an unknown variable when an expression inside the template references outer questions (#10841) - Single-Line Input: The
dataListproperty value is not saved in the survey JSON schema (#10849) - [Mobile] Navigation buttons are too close to the first survey element when they are on top (#10834)
fromJSON()withvalidatePropertyValues: trueproduces an error whenchoicesare defined using a callback that references the object instance (#10845)- Ranking in RTL mode: The drag handle is misaligned, and the drag image is removed from the mouse pointer (#10835)
- Ranking with
selectToRankEnabledin RTL mode does not allow dropping multiple items into the rank area (#10837)
Dashboard
- Inconsistent "Other" Value Display in Dashboard Table when using Multi-Select Dropdown (Tagbox) (#677)
How to Update SurveyJS Libraries in Your Application
Angular
npm i survey-core@v2.5.8 survey-angular-ui@v2.5.8 --save
npm i survey-creator-core@v2.5.8 survey-creator-angular@v2.5.8 --save
npm i survey-analytics@v2.5.8 --save
npm i survey-pdf@v2.5.8 --save
React
npm i survey-core@v2.5.8 survey-react-ui@v2.5.8 --save
npm i survey-creator-core@v2.5.8 survey-creator-react@v2.5.8 --save
npm i survey-analytics@v2.5.8 --save
npm i survey-pdf@v2.5.8 --save
Vue.js
npm i survey-core@v2.5.8 survey-vue3-ui@v2.5.8 --save
npm i survey-creator-core@v2.5.8 survey-creator-vue@2.5.8 --save
npm i survey-analytics@2.5.8 --save
npm i survey-pdf@2.5.8 --save
HTML/CSS/JavaScript
<link href="https://unpkg.com/survey-core@2.5.8/survey-core.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/survey-core@2.5.8/survey.core.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/survey-js-ui@2.5.8/survey-js-ui.min.js"></script>
<script src="https://unpkg.com/survey-core@2.5.8/themes/index.min.js"></script>
<script src="https://unpkg.com/survey-creator-core@2.5.8/themes/index.min.js"></script>
<link href="https://unpkg.com/survey-creator-core@2.5.8/survey-creator-core.min.css" type="text/css" rel="stylesheet">
<script src="https://unpkg.com/survey-creator-core@2.5.8/survey-creator-core.min.js"></script>
<script src="https://unpkg.com/survey-creator-js@2.5.8/survey-creator-js.min.js"></script>
<link href="https://unpkg.com/survey-analytics@2.5.8/survey.analytics.min.css" rel="stylesheet">
<script src="https://unpkg.com/survey-analytics@2.5.8/survey.analytics.min.js"></script>
<script src="https://unpkg.com/survey-pdf@2.5.8/survey.pdf.min.js"></script>
<script src="https://unpkg.com/survey-pdf@2.5.8/pdf-form-filler.min.js"></script>