FabricJS double click on objects

前端 未结 6 490
孤街浪徒
孤街浪徒 2021-01-02 08:04

I am trying to perform a special action whenever the user double clicks any object located inside the canvas. I have read the docs and not found any mouse:dblclick

6条回答
  •  清酒与你
    2021-01-02 08:19

    The Correct way to add custom events to Fabric.js

    window.fabric.util.addListener(canvas.upperCanvasEl, 'dblclick', function (event, self) {
      yourFunction(event);
    });
    

    or use fabric.ext

提交回复
热议问题