Skip to content

Instantly share code, notes, and snippets.

@jgwhite
Created March 1, 2016 12:34
Show Gist options
  • Save jgwhite/d7660bb9ece538e10385 to your computer and use it in GitHub Desktop.
Save jgwhite/d7660bb9ece538e10385 to your computer and use it in GitHub Desktop.
isComposing
import Ember from 'ember';
export default Ember.Controller.extend({
value: '',
updateWithIsComposing(e) {
if (e.isComposing) { return; }
this.set('value', e.target.value);
},
updateWithout(e) {
this.set('value', e.target.value);
}
});
with <code>isComposing</code>:
<input value={{value}} oninput={{action updateWithIsComposing}}>
<br>
without:
<input value={{value}} oninput={{action updateWithout}}>
<br>
{{value}}
{
"version": "0.6.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.3.1/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment