dalgard / meteor-viewmodel

Minimalist VM for Meteor
24 stars 2 forks source link

value binding issue #13

Closed zimt28 closed 8 years ago

zimt28 commented 9 years ago

When using the value binding on an input field, the cursor will always jump to the end of the input when changes have been made. This is just noticeable when you try to edit the input not at the end, but in the middle or so.

dalgard commented 9 years ago

This is a serious flaw – I'll look into it right away. Thanks for reporting.

dalgard commented 9 years ago

Fixed in 0.8.3.

From this version, the set function in the binding is not triggered if the property is updated after an event, i.e. after get. This behavior can be controlled via this.preventSet() (as in the case with the value binding, where the property is updated directly inside get) – or this.preventSet(false) if the binding does wish to trigger set after get.

Saduff commented 8 years ago

I still have this problem in version 1.0.1_1 using Meteor 1.2.1. Ctrl+A to select all doesn't work also.

dalgard commented 8 years ago

Must be a regression. Will fix it right away.

dalgard commented 8 years ago

This regression is fixed in 1.0.2. (I had unintentionally triggered a Tracker flush at the wrong time.)

Saduff commented 8 years ago

Wow, that was fast. Thanks a lot for the package and the quick fix. :)

dalgard commented 8 years ago

If you don't mind my curiosity, what are you using the package for? Feel free to create new issues with any further questions.

Saduff commented 8 years ago

I come from PHP and KnockoutJS, Node and Meteor are quite new to me, only recently started with Meteor. I first tried with only Blaze, but then found the manuel:viewmodel package and thought it would be a good addition. It was good except for one thing which I thought it had - persistence across routes/re-renders. That's an essential thing for me and I'm glad it's in this package. The migration was painless as well.