Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember.js textField change event

Tags:

ember.js

I just start to learn ember.js Why this code http://jsfiddle.net/alexchetv/RVNzP/ don't work properly -- App.MyTextField.change() execution is triggered only after MyTextField loses focus? Alternative code with the same functionality works as expected.

like image 690
AlexChet Avatar asked Feb 18 '26 23:02

AlexChet


1 Answers

Keep in mind that handlers on your Ember.Views (change, select, click, etc) are bound to normal HTML DOM events. "onchange" only gets called on an input field when the field loses focus and has changed, not any time the value is modified. You should observe 'value' if you want to be notified of changes to the displayed value.

like image 115
Christopher Swasey Avatar answered Feb 21 '26 15:02

Christopher Swasey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!