Fixed 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
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.11).

Change log:
Use viewport-relative coordinates when computing nestable drop position so an item can be dropped before the first element of a list.
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom