Browse Source

Fix #1604, Checkbox toggles on spacebar

pull/1627/head
jlukic 9 years ago
parent
commit
1ed26e231b
1 changed files with 2 additions and 1 deletions
  1. 3
      src/definitions/modules/checkbox.js

3
src/definitions/modules/checkbox.js

@ -137,6 +137,7 @@ $.fn.checkbox = function(parameters) {
key = event.which, key = event.which,
keyCode = { keyCode = {
enter : 13, enter : 13,
space : 32,
escape : 27 escape : 27
} }
; ;
@ -146,7 +147,7 @@ $.fn.checkbox = function(parameters) {
.blur() .blur()
; ;
} }
if(!event.ctrlKey && key == keyCode.enter) {
if(!event.ctrlKey && (key == keyCode.enter || key == keyCode.space)) {
module.verbose('Enter key pressed, toggling checkbox'); module.verbose('Enter key pressed, toggling checkbox');
module.toggle.call(this); module.toggle.call(this);
event.preventDefault(); event.preventDefault();

Loading…
Cancel
Save