From 92cba9509b888b71bc9a0a4f673a89c5117e8079 Mon Sep 17 00:00:00 2001
From: Vladislav Mamenko <ktototamovich20@gmail.com>
Date: Tue, 24 Sep 2024 15:16:50 +0300
Subject: [PATCH] fix: #7239: Incorrect behaviour of dragging over DataTable
 rows (#7241)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Владислав Маменко <Vladislav.Mamenko@systeme.ru>
---
 components/lib/datatable/TableBody.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/components/lib/datatable/TableBody.js b/components/lib/datatable/TableBody.js
index aefc7a0836..42db7fb240 100644
--- a/components/lib/datatable/TableBody.js
+++ b/components/lib/datatable/TableBody.js
@@ -678,7 +678,11 @@ export const TableBody = React.memo(
         const onRowDragOver = (e) => {
             const { originalEvent: event, index } = e;
 
-            if (rowDragging.current && draggedRowIndex.current !== index) {
+            if (!rowDragging.current) {
+                return;
+            }
+
+            if (draggedRowIndex.current !== index) {
                 const rowElement = event.currentTarget;
                 const rowY = DomHandler.getOffset(rowElement).top + DomHandler.getWindowScrollTop();
                 const pageY = event.pageY + window.scrollY;