-
-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
目测是以下代码导致:
image/src/hooks/useMouseEvent.ts
Lines 99 to 125 in de622e3
| useEffect(() => { | |
| if (movable) { | |
| window.addEventListener('mouseup', onMouseUp, false); | |
| window.addEventListener('mousemove', onMouseMove, false); | |
| try { | |
| // Resolve if in iframe lost event | |
| /* istanbul ignore next */ | |
| if (window.top !== window.self) { | |
| window.top.addEventListener('mouseup', onMouseUp, false); | |
| window.top.addEventListener('mousemove', onMouseMove, false); | |
| } | |
| } catch (error) { | |
| /* istanbul ignore next */ | |
| warning(false, `[rc-image] ${error}`); | |
| } | |
| } | |
| return () => { | |
| window.removeEventListener('mouseup', onMouseUp); | |
| window.removeEventListener('mousemove', onMouseMove); | |
| // /* istanbul ignore next */ | |
| window.top?.removeEventListener('mouseup', onMouseUp); | |
| // /* istanbul ignore next */ | |
| window.top?.removeEventListener('mousemove', onMouseMove); | |
| }; | |
| }, [open, isMoving, x, y, rotate, movable]); |
示例:
内嵌页面为 Image 组件官网,切换侧边示例会复现上述错误
https://codesandbox.io/p/sandbox/jkt7tk
Metadata
Metadata
Assignees
Labels
No labels
