Skip to content

Commit

Permalink
Disabled repeating-elements after maximum reached. Added messaging to…
Browse files Browse the repository at this point in the history
… user.
  • Loading branch information
hujambo-dunia committed Nov 13, 2023
1 parent ea0fe80 commit fddc75d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/src/components/Form/FormRepeat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ const { keyObject } = useKeyedObjects();
</template>
</FormCard>
<b-button v-if="!props.sustainRepeats" @click="onInsert">
<b-button v-if="!props.sustainRepeats && props.input.cache.length < props.input.max" @click="onInsert">
<FontAwesomeIcon icon="plus" class="mr-1" />
<span data-description="repeat insert">Insert {{ props.input.title || "Repeat" }}</span>
</b-button>
<div v-if="props.input.cache.length >= props.input.max">
Maximum of {{ props.input.cache.length }} {{ props.input.title || "Repeat" }} fields reached
</div>
</div>
</template>

0 comments on commit fddc75d

Please sign in to comment.