SurveyJS v3.2.8
Released: November 26, 2026
SurveyJS v3.2.8 introduces a shared survey options object for setting property defaults and attaching event handlers in Form Library and Survey Creator. It also adds conditional styling for matrix rows and cells and shows Yes/No checkbox answers as checkmarks or dashes in read-only view mode.
New Survey Options Object
This release adds a new survey options object, which allows you to specify per-survey property defaults and attach event handlers that run when the survey loads its JSON. You can also pass the same object to Survey Creator so that authors can test their surveys the way they will run in your application.
Per-Survey Defaults
Previously, we recommended using Serializer to change property defaults. Those changes applied to every survey in your application, including the surveys Survey Creator uses for its own interface. A default value for your form could therefore also change how the Property Grid and other Survey Creator UI elements look or behave.
Now you can specify default property values for each survey in the new propertyDefaults object. It groups default values by SurveyJS class. A default for a specific question type, such as dropdown, takes precedence over a default inherited from a base class such as question. A value set explicitly in the survey JSON takes precedence over both defaults.
import { SurveyModel } from "survey-core";
const survey = new SurveyModel(surveyJson, {
propertyDefaults: {
question: { titleLocation: "left" },
dropdown: { titleLocation: "bottom" }
}
});
Event Handlers During Initialization
Previously, you attached event handlers with .add() after creating a SurveyModel instance. To handle events from the initial JSON load, you had to create an empty survey, attach the handlers, and then load the JSON.
Since v3.2.8, you can pass handlers in the events object when you create the survey. SurveyJS attaches them before loading the JSON.
In the example below, onQuestionCreated logs the name of each question created during that load. To remove a handler, pass the same function to the event's .remove() method.
import { SurveyModel } from "survey-core";
function logQuestionName(_, { question }) {
console.log(question.name);
}
const survey = new SurveyModel(surveyJson, {
events: {
onQuestionCreated: logQuestionName
}
});
survey.onQuestionCreated.remove(logQuestionName);
Share Options Between Survey Creator and Form Library
You can pass the survey options object to Survey Creator through surveyOptions. This lets you set property defaults and add event handlers for the survey that authors configure in Designer and test in Preview. This also resolves the earlier issue with global Serializer defaults affecting Survey Creator's interface.
When you display the saved survey in Form Library, pass the same options object as the second argument to SurveyModel. This gives the displayed survey the same defaults and event handlers.
import { SurveyModel } from "survey-core";
import { SurveyCreatorModel } from "survey-creator-core";
const surveyOptions = {
propertyDefaults: {
question: { titleLocation: "left" },
dropdown: { titleLocation: "bottom" }
},
events: {
onQuestionCreated: (_, { question }) => console.log(question.name)
}
};
const creator = new SurveyCreatorModel({ surveyOptions });
creator.JSON = surveyJson;
const survey = new SurveyModel(creator.JSON, surveyOptions);
Conditional Styling for Matrix Rows and Cells
Dynamic Matrix and Multi-Select Matrix now let you style rows and cells based on their data. In the orders matrix below, the status column determines the row color. Draft rows are amber, approved rows are green, and failed rows are red. The Failed dropdown has a deeper red tint.
Two new survey events allow you to assign CSS classes to an entire row or an individual cell:
onUpdateMatrixRowCss
Styles a data row's<tr>element in the horizontal layout.onUpdateMatrixCellCss
Styles a data cell's<td>element in horizontal and transposed layouts.
Both events run when a row or cell is prepared for display and again when the row's data changes. Append a class to options.css to keep the default classes. Read the row's column values from options.row.value or the current cell's value from options.cellQuestion.value in the cell event.
survey.onUpdateMatrixRowCss.add((_, options) => {
const rowValue = options.row.value;
const status = rowValue && rowValue.status;
if (
options.question.name === "orders" &&
["draft", "approved", "failed"].includes(status)
) {
options.css += ` ${status}-order`;
}
});
survey.onUpdateMatrixCellCss.add((_, options) => {
if (
options.question.name === "orders" &&
options.column.name === "status" &&
options.cellQuestion.value === "failed"
) {
options.css += " failed-status";
}
});
.draft-order {
background-color: var(--sjs2-color-bg-warning-tertiary-dim);
}
.approved-order {
background-color: var(--sjs2-color-bg-positive-tertiary-dim);
}
.failed-order {
background-color: var(--sjs2-color-bg-alert-tertiary-dim);
}
.failed-status {
--sjs2-color-component-formbox-default-bg: var(--sjs2-color-bg-alert-secondary-dim);
--sjs2-color-component-formbox-hovered-bg: var(--sjs2-color-component-formbox-default-bg);
--sjs2-color-component-formbox-focused-bg: var(--sjs2-color-component-formbox-default-bg);
}
Yes/No Checkmarks in Read-Only View Mode
In the recently introduced read-only view mode, Yes/No questions displayed as checkboxes now show a checkmark for Yes and a dash for both No and unanswered responses. This applies to standalone Yes/No questions, Boolean columns in Multi-Select Matrix and Dynamic Matrix, and Yes/No fields in Dynamic Panel.
To enable checkboxes for a Yes/No question or Boolean column, set its displayMode property to "checkbox":
{
"readOnly": true,
"readOnlyMode": "view",
"showNavigationButtons": false,
"pages": [
{
"elements": [
{
"type": "matrixdynamic",
"name": "equipmentInspection",
"title": "Equipment inspection",
"columns": [
{
"name": "equipment",
"title": "Equipment",
"cellType": "text"
},
{
"name": "powersOn",
"title": "Powers on",
"cellType": "boolean",
"displayMode": "checkbox"
},
{
"name": "cablesSecure",
"title": "Cables secure",
"cellType": "boolean",
"displayMode": "checkbox"
},
{
"name": "passed",
"title": "Inspection passed",
"cellType": "boolean",
"displayMode": "checkbox"
}
],
"defaultValue": [
{
"equipment": "Projector",
"powersOn": true,
"cablesSecure": true,
"passed": true
},
{
"equipment": "Microphone",
"powersOn": true,
"cablesSecure": false,
"passed": false
},
{
"equipment": "Speakers",
"cablesSecure": true
}
]
},
{
"type": "boolean",
"name": "inspectionReportReviewed",
"title": "Inspection report reviewed",
"displayMode": "checkbox",
"defaultValue": true
},
{
"type": "boolean",
"name": "followUpScheduled",
"title": "Follow-up scheduled",
"displayMode": "checkbox",
"defaultValue": false,
"startWithNewLine": false
}
]
}
]
}
New Blog Posts
Build a Dynamic Form in Laravel Blade with Bootstrap and SurveyJS
Bug Fixes and Minor Enhancements
Form Library
- MUI theme adapter: Dynamic Panel clips the title of its first field (#12367)
- MUI theme adapter: Divider between Dynamic Panel entries overlaps the following field (#12368)
- MUI theme adapter: Dynamic Panel dividers incorrectly separate error messages from their corresponding fields (#12376)
- MUI theme adapter: Text field error message is separated from its editor when placed alongside a taller field in a panelless theme (#12375)
- shadcn/ui theme adapter: Expand Detail and Remove Row buttons overlap the underlying Dynamic Matrix row (#12320)
- Read-only forms: Focus outline is missing for some fields during Tab navigation (#10643)
autoFocusFirstQuestiondoes not move focus to a collapsed panel when the page opens (#12355)- [a11y] Yes/No (Boolean) question with
displayMode: "radio": Radio buttons lack an accessible association with the question title (#12356) - [a11y] Logo alt text redundantly repeats the survey title (#12357)
- Ranking with randomized items: Setting
survey.randomSeedcauses the list to reorder on the respondent's first move (#12286) - Completing a survey after preview triggers
getRootCssordestroyResizeObservererrors in single-page and question-per-page modes (#12351) - Linter incorrectly reports circular dependencies and unreachable expressions for self-referencing fallback expressions (e.g.,
{x} || today()) (#12407) Serializer.generateSchema()generates an invalid JSON schema by referencing an undefinedstringdefinition forstring[]properties (#12385)- Russian, Serbian, and Macedonian localization strings contain visually similar characters from the wrong alphabet (#12369)
Survey Creator
- Lazy Rendering: Question rows within panels remain unrendered after resizing (#8200)
- JSON Editor tab: Error message text cannot be selected with the mouse (#8204)
- JSON Editor tab: Switching tabs clears the undo/redo history of integrated third-party editors (Ace or Monaco) (#8187)
Dashboard
- Text in Table visualizer use native browser scrollbars instead of themed scrollbars (#890)
How to Update SurveyJS Libraries in Your Application
To update your application to SurveyJS v3.2.8, install the packages you use or replace your existing script and stylesheet links with the versioned links below:
Angular
npm i survey-core@3.2.8 survey-angular-ui@3.2.8
npm i survey-creator-core@3.2.8 survey-creator-angular@3.2.8
npm i survey-analytics@3.2.8
npm i survey-pdf@3.2.8
React
npm i survey-core@3.2.8 survey-react-ui@3.2.8
npm i survey-creator-core@3.2.8 survey-creator-react@3.2.8
npm i survey-analytics@3.2.8
npm i survey-pdf@3.2.8
Vue.js
npm i survey-core@3.2.8 survey-vue3-ui@3.2.8
npm i survey-creator-core@3.2.8 survey-creator-vue@3.2.8
npm i survey-analytics@3.2.8
npm i survey-pdf@3.2.8
HTML/CSS/JavaScript
<link href="https://unpkg.com/survey-core@3.2.8/survey-core.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/survey-core@3.2.8/survey.core.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/survey-js-ui@3.2.8/survey-js-ui.min.js"></script>
<script src="https://unpkg.com/survey-core@3.2.8/themes/index.min.js"></script>
<link href="https://unpkg.com/survey-creator-core@3.2.8/survey-creator-core.min.css" type="text/css" rel="stylesheet">
<script src="https://unpkg.com/survey-creator-core@3.2.8/survey-creator-core.min.js"></script>
<script src="https://unpkg.com/survey-creator-js@3.2.8/survey-creator-js.min.js"></script>
<link href="https://unpkg.com/survey-analytics@3.2.8/survey.analytics.min.css" rel="stylesheet">
<script src="https://unpkg.com/survey-analytics@3.2.8/survey.analytics.min.js"></script>
<link href="https://unpkg.com/survey-analytics@3.2.8/survey.analytics.tabulator.min.css" rel="stylesheet">
<script src="https://unpkg.com/survey-analytics@3.2.8/survey.analytics.tabulator.min.js"></script>
<script src="https://unpkg.com/survey-pdf@3.2.8/survey.pdf.min.js"></script>
<script src="https://unpkg.com/survey-pdf@3.2.8/pdf-form-filler.min.js"></script>
If you are upgrading from v2.x, review the breaking changes introduced in SurveyJS v3.0 and subsequent updates.