mavo icon indicating copy to clipboard operation
mavo copied to clipboard

Add item(s) to multiple collections simultaneously via `add()`

Open DmitrySharabin opened this issue 3 years ago • 1 comments

So that authors could do the following:

<button mv-action="add(foo, inner)">Add</button>

<div mv-list="outer">
  <div>
    <div mv-list="inner">
      <div></div>
    </div>
  </div>
</div>

DmitrySharabin avatar Mar 01 '22 20:03 DmitrySharabin

This should be fairly easy to implement. If we see an array of items that is not a collection itself, we can see if the items of the array belong to any collections and add to those instead.

One question is: What do we do when some items in an array belong to collections and others do not? Do you add to those collections, or do you give up altogether?

LeaVerou avatar Mar 01 '22 20:03 LeaVerou