Updated comments about pressing enter on forms

This commit is contained in:
Brooks Becton 2017-11-14 20:57:36 -06:00
parent 309c1d08ff
commit ffb8b72b69
2 changed files with 3 additions and 1 deletions

View file

@ -197,6 +197,7 @@ Template.editCardTitleForm.onRendered(function () {
Template.editCardTitleForm.events({
'keydown .js-edit-card-title' (evt) {
// If enter key was pressed, submit the data
// Unless the shift key is also being pressed
if (evt.keyCode === 13 && !event.shiftKey) {
$('.js-submit-edit-card-title-form').click();
}

View file

@ -146,7 +146,8 @@ BlazeComponent.extendComponent({
},
pressKey(event) {
//If user press enter key inside a form, submit it, so user doesn't have to leave keyboard to submit a form.
//If user press enter key inside a form, submit it
//Unless the user is also holding down the 'shift' key
if (event.keyCode === 13 && !event.shiftKey) {
event.preventDefault();
const $form = $(event.currentTarget).closest('form');