XF.Nestable cannot move element to the beginning of the list

NikitOS

Well-known member
Licensed customer
Affected version
2.3.10
The position: relative property of .nestable-container and .nestable-list results in different coordinates for e.pageY and pointEl.offsetTop in XF.NestableList.dragMove, causing before to always be false, and the dragged element cannot be placed in front of the first element in the list:
View attachment Screencast_20260325_030537.webm

Possible fix:
Diff:
Index: js/xf/nestable.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/xf/nestable.js b/js/xf/nestable.js
--- a/js/xf/nestable.js
+++ b/js/xf/nestable.js    (date 1774387422941)
@@ -638,7 +638,8 @@
                 {
                     return
                 }
-                let before = e.pageY < (this.pointEl.offsetTop + this.pointEl.offsetHeight / 2)
+                let pointElRect = this.pointEl.getBoundingClientRect(),
+                    before = e.clientY < (pointElRect.top + pointElRect.height / 2)
                 parent = this.placeEl.parentNode
                 if (isEmpty)
                 {
View attachment Screencast_20260325_030431.webm
 
Back
Top Bottom