-
Notifications
You must be signed in to change notification settings - Fork 419
Description
Describe the bug
Validation mode 'ValidateAndHide' does not hide error messages in array object cells (rendered by the React MaterialTableControl)
Expected behavior
The error should be hidden
Steps to reproduce the issue
-
Create a schema with an array of objects, where the object has required properties
e.g.
{ "type": "object", "properties": { "someArray": { "type": "array", "items": { "type": "object", "properties": { "name": {"type": "string"}, "age": {"type": "number"}, }, "required": ["name"], }, }, }, } -
Render the schema with the react material renderers and validation mode
'ValidateAndHide'<JsonForms {...otherProps} validationMode={'ValidateAndHide'} />
Screenshots
| validationMode | screenshot |
|---|---|
| NoValidation | ![]() |
| ValidateAndHide | ![]() |
| ValidateAndShow | ![]() |
Which Version of JSON Forms are you using?
v3.4.1
Package
Core, React Material Renderers
Additional context
I'm not very familiar with the codebase so apologies if this is a red herring, but it looks like the control code which correctly hides the error uses getErrorAt from src/store/jsonFormsCore and this respects validation mode.
Whereas the cell error label instead uses errorsAt which comes from src/util/errors.
There may be a good reason for that of course which I don't understand - but I'd expect cells and controls both to respect that validationMode property


