Skip to content

Commit

Permalink
Add enter to allowed keys in textareas. Fixes #190.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Oct 7, 2013
1 parent 758f7b3 commit e0cada4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/jquery.keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ $.keyboard = function(el, options){
base.wheel = $.isFunction( $.fn.mousewheel ); // is mousewheel plugin loaded?
// keyCode of keys always allowed to be typed - caps lock, page up & down, end, home, arrow, insert & delete keys
base.alwaysAllowed = [20,33,34,35,36,37,38,39,40,45,46];
if (o.enterNavigation) { base.alwaysAllowed.push(13); } // add enter to allowed keys
if (o.enterNavigation || base.el.tagName === "TEXTAREA") { base.alwaysAllowed.push(13); } // add enter to allowed keys; fixes #190
base.$preview
.bind('keypress.keyboard', function(e){
var k = base.lastKey = String.fromCharCode(e.charCode || e.which);
Expand Down

0 comments on commit e0cada4

Please sign in to comment.