Enter key should submit form, not toggle
Closed this issue · 2 comments
sunnysingh commented
The default behavior for checkboxes is to have the space key toggle the checkbox, and the enter key to submit the form. I noticed that both the space and enter keys toggle the checkbox, which is not consistent with browser behavior.
Any thoughts on this and whether this behavior should be fixed?
vsn4ik commented
Thanks for issue!
After testing (HTML5 data-api), I will add:
options.toggleKeyCode = /^(13|32)$/
vsn4ik commented
Use in JavaScript:
$(':checkbox').checkboxpicker({
toggleKeyCodes: [32]
});
or in HTML:
<input type="checkbox" data-toggle-key-codes="[32]">