blikblum / tinybind

Lightweight and powerful data binding + templating solution
http://blikblum.github.io/tinybind/
MIT License
79 stars 14 forks source link

rv-value not updating when model changes through rv-each #17

Closed PoeHaH closed 5 years ago

PoeHaH commented 5 years ago

I have input fields in an rv-each block. Updating an input in the rv-each block does not update the model outside of it.

Check this fiddle: https://jsfiddle.net/7tfpzngv/1/

I want the 1st input field to update whenever an input field in the rv-each block is updated. Somehow I can't get that to work.

blikblum commented 5 years ago

I confirm that.

Here is a new fiddle that do some logging: https://jsfiddle.net/ecp07ymw/

It shows that the array items are updated.

Technically the behavior is correct because the items instance does not change but it seems doable to update the array listeners for when its items are updated

Do you know how vue behaves in similar situation?

PoeHaH commented 5 years ago

I don't, sorry.

Workaround would be to add rv-on-change and then call a change() function but it's not a clean solution.

blikblum commented 5 years ago

I will look into a solution

PoeHaH commented 5 years ago

You're the best!

blikblum commented 5 years ago

Sorry i could not get a way to do it. It should be done manually, with a event listener

PoeHaH commented 5 years ago

No problem - thanks for trying!