|
@@ -56,12 +56,14 @@ export const openShapeMouseStyles = <T extends Shape | Group, R>(
|
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
const stage = shape.getStage();
|
|
const stage = shape.getStage();
|
|
|
|
+ if (!stage) return;
|
|
stage.on(`click.${namespace}${shape.id()}`, (evt) => {
|
|
stage.on(`click.${namespace}${shape.id()}`, (evt) => {
|
|
if (evt.target !== shape) {
|
|
if (evt.target !== shape) {
|
|
active = false;
|
|
active = false;
|
|
mouseHandler(evt);
|
|
mouseHandler(evt);
|
|
}
|
|
}
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
|
+ if (!stage) return;
|
|
stage.off(`click.${namespace}${shape.id()}`);
|
|
stage.off(`click.${namespace}${shape.id()}`);
|
|
});
|
|
});
|
|
});
|
|
});
|