jeudi 23 juin 2016

Ember.js: native input type="number" binding broke when constraining value

Using the new one-way binding of native inputs, I'm trying to stop the data at "999". It appears to constrain it once and reset it back to "999", but then the binding is lost and it continues unbounded.

<input type="number" value= oninput= />

js:

actions: {
  update(value) {
    if (value > 999) {
      this.set('count', 999);
    } else { 
      this.set('count', value);
    }
  }
}

twiddle that demonstrates issue: http://ift.tt/291dkyg

Am I doing something wrong?

linking github issue: http://ift.tt/28QylNH




Aucun commentaire:

Enregistrer un commentaire