Fix bar module position reset on click

This commit is contained in:
David Heinemeier Hansson
2026-05-27 13:58:07 +02:00
parent b9e82a5e53
commit a09cfc3460
+12 -4
View File
@@ -1109,6 +1109,7 @@ Item {
} }
onReleased: function(mouse) { onReleased: function(mouse) {
var wasDragging = dragging
if (dragging) { if (dragging) {
suppressClick = true suppressClick = true
} }
@@ -1123,17 +1124,24 @@ Item {
dragging = false dragging = false
root.barDragTarget = null root.barDragTarget = null
root.barDragAfter = false root.barDragAfter = false
slot.x = 0 if (wasDragging) {
slot.y = 0 slot.x = 0
slot.y = 0
if (slot.parent && typeof slot.parent.forceLayout === "function") slot.parent.forceLayout()
}
} }
onCanceled: { onCanceled: {
var wasDragging = dragging
dragging = false dragging = false
suppressClick = false suppressClick = false
root.barDragTarget = null root.barDragTarget = null
root.barDragAfter = false root.barDragAfter = false
slot.x = 0 if (wasDragging) {
slot.y = 0 slot.x = 0
slot.y = 0
if (slot.parent && typeof slot.parent.forceLayout === "function") slot.parent.forceLayout()
}
} }
onClicked: function(mouse) { onClicked: function(mouse) {