Closed mnsdanwater closed 4 years ago
+1
I found a solution:
isSelected() {
if (this.sketch._fc === undefined) {
return true;
}
const obj = this.sketch._fc.getActiveObject();
return obj !== undefined && obj !== null;
}
I found a solution:
isSelected() { if (this.sketch._fc === undefined) { return true; } const obj = this.sketch._fc.getActiveObject(); return obj !== undefined && obj !== null; }
it works! thank you for your help :)
When user choose Select tool and click copypaste button, it produce error below. How to check an object actually selected before enabling copypaste button? This error also occured on live showcase.
Error log
Uncaught TypeError: Cannot read property 'clone' of null at SketchField.t.copy (index.js:16) at onClick (index.js:45) at Object.<anonymous> (index.js:37) at d (index.js:37) at index.js:37 at x (index.js:37) at O (index.js:37) at B (index.js:37) at M (index.js:37) at En (index.js:37)