Skip to content

Commit 63dc152

Browse files
committed
flyouts: also ignore DetatchFromButton
1 parent 2304b20 commit 63dc152

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

ElvUI_Libraries/Core/LibActionButton-1.0/LibActionButton-1.0.lua

+12-4
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,16 @@ local DefaultConfig = {
270270
},
271271
}
272272

273+
-- Helper function to prevent calls on Blizzards side
274+
local function CreateDummyPopup(frame)
275+
local popup = frame or CreateFrame('Frame')
276+
277+
popup.AttachToButton = noop
278+
popup.DetatchFromButton = noop
279+
280+
return popup
281+
end
282+
273283
--- Create a new action button.
274284
-- @param id Internal id of the button (not used by LibActionButton-1.0, only for tracking inside the calling addon)
275285
-- @param name Name of the button frame to be created (not used by LibActionButton-1.0 aside from naming the frame)
@@ -294,8 +304,7 @@ function lib:CreateButton(id, name, header, config)
294304
button:RegisterForClicks("AnyUp")
295305
end
296306

297-
button.popup = CreateFrame('Frame')
298-
button.popup.AttachToButton = noop
307+
button.popup = CreateDummyPopup()
299308

300309
button.cooldown:SetFrameStrata(button:GetFrameStrata())
301310
button.cooldown:SetFrameLevel(button:GetFrameLevel() + 1)
@@ -1143,8 +1152,7 @@ if UseCustomFlyout then
11431152
for i = #lib.FlyoutButtons + 1, maxNumSlots do
11441153
local button = lib:CreateButton(i, "LABFlyoutButton" .. i, lib.flyoutHandler, nil)
11451154

1146-
button.popup = CreateFrame('Frame')
1147-
button.popup.AttachToButton = noop
1155+
button.popup = CreateDummyPopup()
11481156

11491157
button:SetScale(0.8)
11501158
button:Hide()

0 commit comments

Comments
 (0)