Skip to content

Commit 8e47053

Browse files
authored
Merge pull request #236 from minop1205/fix-235
Fixed: Incorrect element detection for `dropTarget` class
2 parents 0f54bc9 + 1bef365 commit 8e47053

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## 3.5.2
4+
5+
_Apr 21, 2025_
6+
7+
### Fixed
8+
9+
- Incorrect element detection for `dropTarget` class.
10+
311
## 3.5.0
412

513
_Jan 13, 2025_

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@minoru/react-dnd-treeview",
33
"description": "A draggable / droppable React-based treeview component.",
4-
"version": "3.5.0",
4+
"version": "3.5.2",
55
"license": "MIT",
66
"repository": {
77
"type": "git",

src/utils/getDropTarget.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ const getHoverPosition = <T>(
7272
): VerticalPosition => {
7373
const bbox = el.getBoundingClientRect();
7474
const offsetY = context.dropTargetOffset;
75+
76+
if (offsetY === 0) {
77+
return "middle";
78+
}
79+
7580
const upSideY = bbox.top + offsetY;
7681
const lowerSideY = bbox.bottom - offsetY;
7782

0 commit comments

Comments
 (0)