mavoweb / mavo

Create web applications entirely by writing HTML and CSS!
https://mavo.io
MIT License
2.84k stars 176 forks source link

Collection actions (add, move, delete) should work on primitives with array values too #753

Open DmitrySharabin opened 3 years ago

DmitrySharabin commented 3 years ago

Since we can get collections based on lists, it would be nice if we could perform custom actions on lists as well.

E.g., we could have the code like this:

<meta property="foo" content="[list('foo', 'baz')]">
<p mv-multiple mv-value="foo"></p>

<button mv-action="add('bar', foo)">Add bar</button>
<button mv-action="delete(foo where 'bar')">Delete bar</button>
<button mv-action="move(foo where 'baz', 0)">Make baz first</button>

What do you think?

LeaVerou commented 3 years ago

Oh yes, absolutely. I'd go as far as to say that it's a bug that this doesn't work today!