Skip to content

Commit

Permalink
feat(checkbox): add toggle on ENTER-key option
Browse files Browse the repository at this point in the history
Closes #819
  • Loading branch information
lubber-de authored and Sean committed Jun 24, 2019
1 parent d880d35 commit 5d16709
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/definitions/modules/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ $.fn.checkbox = function(parameters) {
$input.blur();
shortcutPressed = true;
}
else if(!event.ctrlKey && ( key == keyCode.space || key == keyCode.enter) ) {
else if(!event.ctrlKey && ( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey)) ) {
module.verbose('Enter/space key pressed, toggling checkbox');
module.toggle();
shortcutPressed = true;
Expand Down Expand Up @@ -829,6 +829,7 @@ $.fn.checkbox.settings = {
// delegated event context
uncheckable : 'auto',
fireOnInit : false,
enableEnterKey : true,

onChange : function(){},

Expand Down

0 comments on commit 5d16709

Please sign in to comment.