dalgard / meteor-viewmodel

Minimalist VM for Meteor
24 stars 2 forks source link

Change even not functional #22

Open KoenLav opened 8 years ago

KoenLav commented 8 years ago

After removing the jQuery dependency the change event on selects is no longer fully functional (when using Materialize, or any other package which wraps selects, for that matter).

jQuery change will listen for any change (even programatically) on the original element, whereas pure Javascript change will only listen fire when a change is accompanied by a change of focus (which does not occur when a select is changed programatically).

http://stackoverflow.com/questions/7055729/onchange-event-not-fire-when-the-change-come-from-antoher-function

Suggested fix: allow jQuery to be used by setting addBinding)){ jQuery: true })

dalgard commented 8 years ago

I think a better fix would be triggering the change event manually inside the binding. What do you think?

KoenLav commented 8 years ago

Well it depends. If you want to loose jQuery as a dependency, which I understand, you also loose some functionality.

jQuery is pretty 'default' in Meteor, so I think most people would Epe expect it to be possible to use jQuery bindings