Skip to content

Instantly share code, notes, and snippets.

@lennyburdette
Created February 10, 2018 01:03
Show Gist options
  • Select an option

  • Save lennyburdette/bba47d4d8af2edb29e47750cd254224e to your computer and use it in GitHub Desktop.

Select an option

Save lennyburdette/bba47d4d8af2edb29e47750cd254224e to your computer and use it in GitHub Desktop.
form submit on enter test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
formSubmit() {
alert('submitted');
}
}
});
<form onsubmit={{action "formSubmit"}} tabindex="0">
<input>
</form>
<p>(focus the field, then shift-tab to focus the form, then hit enter. nothing will happen)</p>
{
"version": "0.13.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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment