Ali Nawaz Hiraj
Ali Nawaz Hiraj

Reputation: 122

Fabric.js stop responding in chrome at start

I have created a photo editor using fabric.js, but when I launch my web page at localhost and add a photo to the canvas, the resizing and movements of the photo don't respond at all. But when I click "Inspect element" and close it, everything starts working normally. I don't understand what's the problem here? Every timec I have to open "Inspect element" once to make canvas respond.

A little help would be greatly appreciated!

Upvotes: 0

Views: 115

Answers (1)

quangthang10d4
quangthang10d4

Reputation: 38

I have came across the same problem. My work around is:

  • After adding the element to the canvas, render the canvas by doing: canvas.renderAll();
  • Then calculate the offset by doing: canvas.calcOffset();

It works for me.

Upvotes: 1

Related Questions