Skip to content

Commit

Permalink
Merge pull request #636 from Original-Recipe/feat-fullscreenDragPref
Browse files Browse the repository at this point in the history
feat: Optimize full screen drag and drop
  • Loading branch information
lihqi authored Feb 19, 2025
2 parents 557597e + 9d4e094 commit accbc71
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ const SideAndBackOverView = (props: IProps) => {
});
}
}}
onDragOver={(event) => {
// Prevent default drag and drop behavior to prevent shadow issues
event.preventDefault();
}}
onDrag={(e: any) => {
// Prevent boundary issues caused by dragging and overflowing the screen
if (e.clientX === 0 && e.clientY === 0) return;
const moveX = e.clientX - offset.x;
const moveY = e.clientY - offset.y;
setPosition({ x: moveX, y: moveY });
}}
onDragEnd={(e: any) => {
// Prevent boundary issues caused by dragging and overflowing the screen
if (e.clientX === 0 && e.clientY === 0) return;
const moveX = e.clientX - offset.x;
const moveY = e.clientY - offset.y;
setPosition({ x: moveX, y: moveY });
Expand Down

0 comments on commit accbc71

Please sign in to comment.