Fix crash with interacting with page while loading
This commit is contained in:
parent
ddda241c56
commit
9fa8667081
@ -26,8 +26,10 @@ function useStageInteraction(
|
||||
...gesture,
|
||||
onWheelStart: (props) => {
|
||||
const { event } = props;
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
if (layer) {
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
}
|
||||
gesture.onWheelStart && gesture.onWheelStart(props);
|
||||
},
|
||||
onWheel: (props) => {
|
||||
@ -61,8 +63,10 @@ function useStageInteraction(
|
||||
},
|
||||
onPinchStart: (props) => {
|
||||
const { event } = props;
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
if (layer) {
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
}
|
||||
const { da, origin } = props;
|
||||
const [distance] = da;
|
||||
const [originX, originY] = origin;
|
||||
@ -123,8 +127,10 @@ function useStageInteraction(
|
||||
},
|
||||
onDragStart: (props) => {
|
||||
const { event } = props;
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
if (layer) {
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
}
|
||||
gesture.onDragStart && gesture.onDragStart(props);
|
||||
},
|
||||
onDrag: (props) => {
|
||||
|
Loading…
Reference in New Issue
Block a user