H
H
hagen17782014-11-03 12:18:18
JavaScript
hagen1778, 2014-11-03 12:18:18

How to catch a bug?

When implementing one project on the canvas, a bug was noticed that is hard to catch. There is a Point object that has a certain set of properties and is drawn on the canvas. When you click on an object, a certain function must be called. In the project, this is implemented as follows:

point.on('click', function () {
                someFunction();

And everything seems to be working, but... After a long time of working with this object, the event stops working. Nothing appears in the console, no errors, all other components continue to work, but the Point object does not respond to click. Reloading the page doesn't help either. Just a full browser reload.
An attempt to change the event at the time of initialization did not help either:
point.off('click').on('click', function () {
                someFunction();
            });

If you hang another event on the object, for example mouseUp, then everything works stably. For two days, the bug was not noticed, but this is not a suitable option, since the dredge processing also hangs on the object, and this sometimes leads to an incorrect call of the mouseUp event.
Help to understand, please!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question