Closed MrEd69 closed 8 years ago
Can you provide example?
Sorry, I tried to reproduce, but now at work with a different PC/mouse everything works. False alarm.
I'm having the same issue.
const object = new Konva.Circle({
100,
100,
radius: 5,
fill: '#fafafa',
stroke: 'black',
strokeWidth: 1,
draggable: true,
});
object.on('click', function() {
console.log('click');
});
map.itemLayer.add(object);
No output from the console. After changing draggable
to false, I get output. Same with dblclick
event. Mouseover and other events are working.
@ivokund try to set dragDistance
to some value (e.g. 5).
I guess on your case click doesn't work because it triggers drag&drop (mousedown
position != mouseup
position).
http://konvajs.github.io/api/Konva.Shape.html#dragDistance
Yes, this helped, thanks!
I tried to migrate from KineticJS to KonvaJS, and found out, that draggable layers will not get the click or dblclick event. I think (cannot confirm now), that tap and dbltap would also not work.