From 915ff8e78538d9e3c16c7e2b247a27a424f71d40 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 24 Nov 2011 11:41:52 -0500 Subject: Catch more events --- lib/js/urweb.js | 2 +- tests/ccheckbox.ur | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/ccheckbox.ur diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 3829cdb2..a6ea21c1 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -894,7 +894,7 @@ function chk(s) { var x = input(document.createElement("input"), s, function(x) { return function(v) { if (x.checked != v) x.checked = v; }; }, "checkbox"); x.defaultChecked = x.checked = s.data; - x.onclick = function() { sv(s, x.checked) }; + x.onclick = x.onkeyup = x.oninput = x.onchange = x.onpropertychange = function() { sv(s, x.checked) }; return x; } diff --git a/tests/ccheckbox.ur b/tests/ccheckbox.ur new file mode 100644 index 00000000..09a8ece9 --- /dev/null +++ b/tests/ccheckbox.ur @@ -0,0 +1,8 @@ +fun main () : transaction page = + s <- source True; + t <- source 1; + return + {[s]} {[t]}}/> + -- cgit v1.2.3