How to forbid delete of all items inside a collection? #813
-
Hi Inside a collection (without "add new item to collection" button), how to: Option 1: Display a button in case items =0 I know there's I've been trying to do option 1 here: https://codepen.io/GATIGA/pen/MWERdzP Thanks for your help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Based on @LeaVerou 's work about "shopping List" ,(included on my codepen for testing) button appears when I delete text inside the input (not with delete item-button) unfortunately, this is not what I am looking for Any idea on how to achieve this? |
Beta Was this translation helpful? Give feedback.
-
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 @LeaVerou could you please take a look at whether it's a bug or I'm doing something wrong? |
Beta Was this translation helpful? Give feedback.
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 (theAdd to list
button doesn't disappear after an item is added to the list; theDelete
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?