Vue: Disable ArrayListRenderer add if control.data.length exceeds or is equal to maxItems#2154
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…nstead of control.rootschema, and referenced appliedOptions.restrict
|
Thanks for the feedback @sdirix. I have also implemented minItems checking on the delete button. I've left one comment on your review. But besides this it should be ready for re-evaluation |
Besides the Vuetify renderers (ListWithDetail, ArrayControlRenderer, AdditionalProperties, AnyOfStringOrEnumControlRenderer, MultiStringControlRenderer, PasswordControlRenderer, StringControlRenderer, StringMaskControlRenderer, ArrayLayoutRenderer), restrict is used in various string and number renderers, see MaterialAnyOfStringOrEnumControl, MuiInputNumberFormat, MuiInputText, NumberFormatCell, TextCell.
You can set it in each Ui Schema options, e.g. Or globally via the config |
|
@sdirix Thanks for the comments about the appliedOptions.restrict. I have added this to the control. I have also addressed your latest points |
sdirix
left a comment
There was a problem hiding this comment.
Thanks for the contribution ❤️
The included ArrayListRenderer in Vue-Vanilla would allow more items to be added to an array than the schema allowed.
This PR uses the maxItems value from the schema (if present) and disables the add button if the control.data array is an equal, or greater, length to the maxItems value in the schema