From cbfde846075aa8a9caec9556f8170f380127e848 Mon Sep 17 00:00:00 2001 From: Michael Stocks Date: Tue, 4 Jul 2023 09:44:16 +0200 Subject: [PATCH 01/13] Disables Add button in ArrayListRenderer if MaxItems is exceeded --- packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue b/packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue index 2674df945..69f2c6a4b 100644 --- a/packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue +++ b/packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue @@ -5,6 +5,10 @@ :class="styles.arrayList.addButton" type="button" @click="addButtonClick" + :disabled="!control.enabled || + (control.schema !== undefined && + control.schema.maxItems !== undefined && + control.data.length >= control.schema.maxItems)" > + From b0b9be77a053df67ab4caab3576cc83a602e699d Mon Sep 17 00:00:00 2001 From: Michael Stocks Date: Tue, 4 Jul 2023 10:34:12 +0200 Subject: [PATCH 02/13] ensured changes are functional after testing --- .../vue-vanilla/src/array/ArrayListRenderer.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue b/packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue index 69f2c6a4b..d202503e9 100644 --- a/packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue +++ b/packages/vue/vue-vanilla/src/array/ArrayListRenderer.vue @@ -6,10 +6,11 @@ type="button" @click="addButtonClick" :disabled="!control.enabled || - (control.schema !== undefined && - control.schema.maxItems !== undefined && - control.data.length >= control.schema.maxItems)" - > + (arraySchema !== undefined && + arraySchema.maxItems !== undefined && + control.data !== undefined && + control.data.length >= arraySchema.maxItems)" + > +