简体   繁体   中英

Deselect object in Fabric JS

I have created a canvas having a background image and then I open a file selector to render a dynamic image on the canvas. But when I select an image from the file selector a blue selector is showing on canvas.
How to disable that blue selector. Following is a screenshot of canvas with blue selector

在此处输入图片说明

I have tried

1) canvas.discardActiveObject();  
2) canvas.renderAll();  
3) canvas.deactivateAll().renderAll();  
4) canvas.discardActiveObject().renderAll();

Add canvas.selection = false; to mouse move function.

canvas.on('mouse:move', function(e) {
//turn off selection
canvas.selection = false;
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM