Tisha
Tisha

Reputation: 857

fabric mouse events not triggered

I am new to using fabric and canvas in general.

This is how I am initializing canvas:

fabric.isTouchSupported = false;
myService.setCanvas(new fabric.Canvas('myCanvas', {selection: false, allowTouchScrolling: false}));

I have tried disabling even chrome flags that might invoke touch event instead of mouse events - chrome://flags/

The mouse events are triggered right the first time my canvas loads. However, I go back to my home page and then come to my canvas page and it stops reading mouse events.

What might be the reason?

I can provide more information if needed.

Upvotes: 0

Views: 416

Answers (1)

Tisha
Tisha

Reputation: 857

I found the issue. So my application was creating multiple canvas objects without checking if a canvas object already exists. After I controlled that, it works as expected.

Upvotes: 1

Related Questions