Skip to content

Commit

Permalink
fix: 修复拖拽事件冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
moshangqi committed Oct 25, 2023
1 parent 777d65f commit a41e5a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions src/pages/inject/ScreenShot/DragMoveArea.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
border: 2px solid #00B96B;
box-sizing: border-box;
cursor: pointer;

.dargArea {
width: 100%;
height: 100%;
}
}

.dragBarMask {
Expand Down
20 changes: 10 additions & 10 deletions src/pages/inject/ScreenShot/DragMoveArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { useRef, useState } from 'react';
import styles from './DragMoveArea.module.less';

export interface IMoveParams {
x: number; y: number;
x: number;
y: number;
}

interface IDragResizeCircleProps {
Expand Down Expand Up @@ -39,15 +40,14 @@ const DragMoveArea = (props: IDragResizeCircleProps) => {

return (
<>
<div
className={styles.area}
id="yq-area"
style={props.style}
onMouseDown={handleDragStart}
onDragStart={handleDragStart}
onDrag={handleDrag}
onDragEnd={handleDragEnd}
>
<div className={styles.area} id="yq-area" style={props.style}>
<div
className={styles.dargArea}
onMouseDown={handleDragStart}
onDragStart={handleDragStart}
onDrag={handleDrag}
onDragEnd={handleDragEnd}
/>
{props.children}
</div>
{dragging && (
Expand Down

0 comments on commit a41e5a5

Please sign in to comment.