Reputation: 21
I need to hide all controls of fabric js when we click on fabric canvas ie: no move object or scale or anything , that canvas should be feel like a static webpage. your help will be apricated :) thank you.
Upvotes: 0
Views: 2312
Reputation: 374
I think there are two ways to do it
.disable-pointer-events{ pointer-events:none;}
function enableStatic(){
fabric.Object.prototype.selectable = false;
fabric.Object.prototype.hoverCursor = "default";
}
or
canvas.forEachObject((ob) => {
ob.selectable = false;
ob.hoverCursor="default";
});
Here is the working demo for option 2 https://codepen.io/ad121/pen/MWGgXbX
Upvotes: 0