@talend/json-schema-form-core
Advanced tools
Comparing version 1.2.1 to 1.2.2
# @talend/json-schema-form-core | ||
## 1.2.2 | ||
### Patch Changes | ||
- 5d631f2: TMC-27327 - Fix input number validation to display correct error message | ||
## 1.2.1 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@talend/json-schema-form-core", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "JSON-Schema and JSON-UI-Schema utilities for form generation.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -8,3 +8,3 @@ /* Common code for validating a value against its form and schema definition */ | ||
// If the user types a non-integer value, the value is emptied by browser but still displayed in UI | ||
if (event.target?.validity && !event.target.validity.valid) { | ||
if (event.target?.validity && event.target.validity.badInput) { | ||
return { valid: false, message: 'CUSTOM_ERROR_INVALID_INPUT' }; | ||
@@ -11,0 +11,0 @@ } |
@@ -27,3 +27,3 @@ import { validate } from './validate'; | ||
const testForm = { type: 'number', key: ['hero'], schema: { type: 'number' } }; | ||
const event = { target: { validity: { valid: false } } }; | ||
const event = { target: { validity: { badInput: true } } }; | ||
let result = validate(testForm, value, event); | ||
@@ -30,0 +30,0 @@ expect(result.error.message).toBe('CUSTOM_ERROR_INVALID_INPUT'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1299016
7671