New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkbox state is inconsistent on mobile for "up" event #493
Comments
So far, the "change" event is the only registered event. Would this be sufficient? |
I think this would work well, but when I register for "change" the handler doesn't fire for me. Here is a repro of what I was seeing, meant to run in the <html>
<head>
<title>Board events</title>
<link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
<script type="text/javascript" src="../distrib/jsxgraphcore.js"></script>
</head>
<body>
<div id="jxgbox" class="jxgbox" style="width: 800px; height: 800px; float: left"></div>
<script type="text/javascript">
/* <![CDATA[ */
var board = JXG.JSXGraph.initBoard("jxgbox", {
boundingbox: [-1, 1, 1, -1],
axis: true,
grid: true
});
var check = board.create("checkbox", [0.5, 0.5, "Toggle"]);
check.on("up", function () {
console.log("on up: " + this.Value());
});
check.on("change", function () {
console.log("on change: " + this.Value());
});
/* ]]> */
</script>
</body>
</html> |
This is strange. Your example works for me in Firefox and Brave, see https://jsfiddle.net/do6f5ng2/ for 1.4.6 and https://jsfiddle.net/wdpufa98 for 1.5.0-rc1. It also works for me if I include JSXGraph with |
Sorry, my last answer was completely wrong. I did not distinguish the event handlers in your example.
var check = board.create('checkbox', [0, 4, 'Click me']),
p = board.create('point', [1, 1]);
JXG.addEvent(check.rendNodeCheckbox, 'change', function() {
console.log("on change: " + this.Value());
}, check); See also the documentation at https://jsxgraph.org/docs/symbols/Checkbox.html. |
Like in #492, I've implemented the Euler curve demo with state stored external to the board. I'm attempting to use the "up" event on a checkbox to register when the state changes.
Here is the demo: https://jsxgraph.mentat.org/#what_is_jsxgraph?
I've found two issues:
!arg.Value()
, I can get the demo to work.Is this a bug? Or am I perhaps not using the correct event?
Thank you!
The text was updated successfully, but these errors were encountered: