accessibility support for CheckBox
This commit is contained in:
parent
74e3c0908b
commit
1a982809f6
@ -36,11 +36,22 @@ function CheckBox(parentElement)
|
|||||||
|
|
||||||
var child = document.createElement("div");
|
var child = document.createElement("div");
|
||||||
child.className = "uwt-checkbox";
|
child.className = "uwt-checkbox";
|
||||||
|
child.tabIndex = 0;
|
||||||
child.NativeObject = this;
|
child.NativeObject = this;
|
||||||
child.addEventListener("click", function(e)
|
child.addEventListener("click", function(e)
|
||||||
{
|
{
|
||||||
this.NativeObject.ToggleChecked();
|
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");
|
var fa = document.createElement("i");
|
||||||
fa.className = "fa fa-check";
|
fa.className = "fa fa-check";
|
||||||
child.appendChild(fa);
|
child.appendChild(fa);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user