fix: opening bags when equipped item is dragged

This commit is contained in:
Salikh Gurgenidze
2026-01-04 17:47:37 +04:00
parent a47828174d
commit 7661625803
2 changed files with 42 additions and 4 deletions
+21 -2
View File
@@ -276,9 +276,28 @@ function BagFrame:Update()
end
-- If cursor is holding an item (mid-drag), only update lock states, don't rebuild UI
-- BUT only if we already have items displayed - otherwise we need to do initial build
if CursorHasItem and CursorHasItem() then
self:UpdateLockStates()
return
-- Check if we have any displayed items
local hasDisplayedItems = false
for _, bagParent in pairs(bagParents) do
if bagParent then
local children = { bagParent:GetChildren() }
for _, button in ipairs(children) do
if button.hasItem and button:IsShown() then
hasDisplayedItems = true
break
end
end
end
if hasDisplayedItems then break end
end
if hasDisplayedItems then
self:UpdateLockStates()
return
end
-- If no items displayed yet, continue with full update
end
-- Mark all existing buttons as not in use (we'll mark active ones during display)
+21 -2
View File
@@ -128,9 +128,28 @@ function BankFrame:Update()
end
-- If cursor is holding an item (mid-drag), only update lock states, don't rebuild UI
-- BUT only if we already have items displayed - otherwise we need to do initial build
if CursorHasItem and CursorHasItem() then
self:UpdateLockStates()
return
-- Check if we have any displayed items
local hasDisplayedItems = false
for _, bankBagParent in pairs(bankBagParents) do
if bankBagParent then
local children = { bankBagParent:GetChildren() }
for _, button in ipairs(children) do
if button.hasItem and button:IsShown() then
hasDisplayedItems = true
break
end
end
end
if hasDisplayedItems then break end
end
if hasDisplayedItems then
self:UpdateLockStates()
return
end
-- If no items displayed yet, continue with full update
end
-- Mark all existing buttons as not in use (we'll mark active ones during display)