Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
Forked from welzie/controllers.application.js
Created January 28, 2017 03:24
Show Gist options
  • Save kumkanillam/69764475967eda29f7a58a61efd6a436 to your computer and use it in GitHub Desktop.
Save kumkanillam/69764475967eda29f7a58a61efd6a436 to your computer and use it in GitHub Desktop.
prevent input click propogation
import Ember from 'ember';
export default Ember.TextField.extend({
click(){
console.log('click my input');
return false;
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
alert() {
window.alert('clicked me');
}
}
});
<div style="border: 1px solid red; padding: 10px;" {{action "alert"}}>
I don't want the click into the input to trigger the div onlick. Help!<br/>
{{my-input }}
</div>
{
"version": "0.11.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment