diff --git a/core/survey/_surveyValidator/nodeDefValidationsValidator.js b/core/survey/_surveyValidator/nodeDefValidationsValidator.js index 650e905b03..71f81e729d 100644 --- a/core/survey/_surveyValidator/nodeDefValidationsValidator.js +++ b/core/survey/_surveyValidator/nodeDefValidationsValidator.js @@ -16,7 +16,7 @@ const validateCountProp = const count = Validator.getProp(propName)(item) return Array.isArray(count) ? NodeDefExpressionsValidator.validate(survey, nodeDef, dependencyType) - : Validator.validatePositiveNumber(errorKey)(propName, item) + : Validator.validatePositiveOrZeroNumber(errorKey)(propName, item) } export const validate = async (survey, nodeDef) => { diff --git a/webapp/components/survey/NodeDefDetails/ValidationsProps.js b/webapp/components/survey/NodeDefDetails/ValidationsProps.js index 3e43aa5680..9131a6afe0 100644 --- a/webapp/components/survey/NodeDefDetails/ValidationsProps.js +++ b/webapp/components/survey/NodeDefDetails/ValidationsProps.js @@ -22,6 +22,8 @@ import { State } from './store' const countTypes = [NodeDefValidations.keys.min, NodeDefValidations.keys.max] +const countPropNumberFormat = NumberFormats.integer({ allowNegative: false }) + const CountProp = (props) => { const { Actions, countType, nodeDef, nodeDefUuidContext, readOnly, state } = props @@ -65,7 +67,7 @@ const CountProp = (props) => { excludeCurrentNodeDef valueTypeSelection determineValueType={determineValueType} - valueConstantEditorNumberFormat={NumberFormats.integer()} + valueConstantEditorNumberFormat={countPropNumberFormat} /> )