I have a canvas on which on doubleclick event I create a box object. On box object I want to assign a click event but the problem that occurs is since box gets drawn in canvas. The single click is also registered with canvas and a next click creates another box.
Share
How are you handling each? You dont want to have a click handler and dblclick handler assigned to the same element.
Personally I would assign a click handler, check bounds of where the user is clicking to see if its within the created rect on the canvas, and do what you need. For double clicking I would set some sort of time threshold in the click event to find out if it was a double click or not.