fix: improve stitch cut line dragging
This commit is contained in:
parent
1cf4cf3ac0
commit
1487531b8c
@ -583,6 +583,12 @@ export function AgentDetailReferenceStitchDialog({
|
|||||||
const handleLinePointerDown = useCallback(
|
const handleLinePointerDown = useCallback(
|
||||||
(index: number) => (event: ReactPointerEvent<HTMLDivElement>) => {
|
(index: number) => (event: ReactPointerEvent<HTMLDivElement>) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
try {
|
||||||
|
event.currentTarget.setPointerCapture(event.pointerId);
|
||||||
|
} catch {
|
||||||
|
// Older browsers may not support pointer capture for this target.
|
||||||
|
}
|
||||||
setDraggingLineIndex(index);
|
setDraggingLineIndex(index);
|
||||||
},
|
},
|
||||||
[]
|
[]
|
||||||
@ -876,7 +882,7 @@ export function AgentDetailReferenceStitchDialog({
|
|||||||
<div
|
<div
|
||||||
onPointerDown={handleLinePointerDown(index)}
|
onPointerDown={handleLinePointerDown(index)}
|
||||||
className={cn(
|
className={cn(
|
||||||
"pointer-events-auto absolute inset-x-0 z-10 flex -translate-y-1/2 cursor-row-resize items-center justify-center",
|
"pointer-events-auto absolute inset-x-0 z-10 flex h-10 -translate-y-1/2 cursor-row-resize touch-none select-none items-center justify-center",
|
||||||
draggingLineIndex === index && "z-20"
|
draggingLineIndex === index && "z-20"
|
||||||
)}
|
)}
|
||||||
style={{ touchAction: "none" }}
|
style={{ touchAction: "none" }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user