-
Notifications
You must be signed in to change notification settings - Fork 419
Description
Describe the bug
When using the default ArrayLayoutRenderer provided by @jsonforms/angular-material package I can see wrong number displayed in the errors icon badge. This is because the count is done using matBadge="{{ this.error.split('').length }}" which is wrong as it is splitting the error by empty string '' and basically counting every character that is in the message. In my case the message is is a required property and the number shown is 22 as it contains 22 characters. Here is an example:
Expected behavior
The expected behavior should count the number of errors and not the characters. The split should be by a newline character \n instead. Something like this: matBadge="{{ this.error.split('\n').length }}" Here is an example:
Steps to reproduce the issue
- Add an array of objects in the schema. Something like this:
{ "type": "object", "properties": { "creators": { "type": "array", "minItems": 1, "items": { "type": "object", "properties": { "name": { "type": "string", "title": "Name", "$dataciteRequired": true }, "nameType": { "type": "string", "title": "Name Type", "$dataciteRequired": false, "enum": ["Personal", "Organizational"] }, "givenName": { "type": "string", "title": "Given Name", "$dataciteRequired": false }, "familyName": { "type": "string", "title": "Family Name", "$dataciteRequired": false } } } } } }
Screenshots
No response
Which Version of JSON Forms are you using?
v3.6.0
Package
Core, Angular Material Renderers, Angular Bindings
Additional context
No response