javascriptfabricjsopenseadragon

Fabric getPointer method not working in Firefox


I have an Openseadragon canvas with Fabricjs overlay. I am adding a rectangle wherever user clicks on canvas. It works fine in MS Edge and Google Chrome but in Firefox it gives event is undefined error. Here is the plunker: FabricJs Plunker


Solution

  • You need to pass options.originalEvent instead of options.e in

    var rectLocation = overlay.fabricCanvas().getPointer(options.originalEvent);

    canvas-click doc

    Here is updated plunker.