Skip to content

How to forbid delete of all items inside a collection? #813

Answered by DmitrySharabin
GalinhaLX asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there, 👋🏻

I believe we can approach this in different ways. Here are the ones I came up with: https://codepen.io/dmitrysharabin/pen/yLzWyxg?editors=1100. Did I get you correctly?

Please, note that there I'm using the new (upcoming) syntax for collections. Let me know if you want me to build this pen using the stable version of Mavo.

However, it seems to me, something is wrong with mv-if: the expression isn't being recalculated (the Add to list button doesn't disappear after an item is added to the list; the Delete button doesn't reappear when the list has more than one item).

@LeaVerou could you please take a look at whether it's a bug or I'm doing something wrong?

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@LeaVerou
Comment options

@DmitrySharabin
Comment options

@GalinhaLX
Comment options

Answer selected by GalinhaLX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants