diff --git a/lib/phast/client/scripts/controls/CheckBox.js b/lib/phast/client/scripts/controls/CheckBox.js index b265365..558efd3 100644 --- a/lib/phast/client/scripts/controls/CheckBox.js +++ b/lib/phast/client/scripts/controls/CheckBox.js @@ -36,11 +36,22 @@ function CheckBox(parentElement) var child = document.createElement("div"); child.className = "uwt-checkbox"; + child.tabIndex = 0; child.NativeObject = this; child.addEventListener("click", function(e) { this.NativeObject.ToggleChecked(); }); + child.addEventListener("keydown", function(e) + { + if (e.keyCode === KeyboardKeys.Space) + { + this.NativeObject.ToggleChecked(); + e.preventDefault(); + e.stopPropagation(); + return false; + } + }); var fa = document.createElement("i"); fa.className = "fa fa-check"; child.appendChild(fa);