Skip to content

Commit 506dc5d

Browse files
committed
Slot 1 X opens gem picker instead of removing main skill
Guard the GemSelectControl focusLost+no-match branch (introduced by upstream PR #1843) against deleting the main active skill, matching the X-button handler's slot-1 protection. Without this guard, clicking X on slot 1 would open the gem picker as intended, but closing the picker (Escape / click-away / re-click X) without selecting a gem would trigger GemSelectControl:OnFocusLost -> UpdateGem(..., focusLost=true) -> the new "elseif focusLost and not bufMatchesGem" branch in the nameSpec callback, which calls deleteGem() and removes the main active skill. For slot >= 2 the upstream auto-clean behavior is preserved.
1 parent 79312d8 commit 506dc5d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Classes/SkillsTab.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,10 @@ function SkillsTabClass:CreateGemSlot(index)
772772
slot.enableGlobal2.state = true
773773
slot.count:SetText(gemInstance.count)
774774
elseif focusLost and not bufMatchesGem then
775+
if index == 1 then
776+
-- Slot 1 (main active skill) must never auto-delete on focus loss
777+
return
778+
end
775779
return deleteGem()
776780
elseif gemId == gemInstance.gemId then
777781
if addUndo then

0 commit comments

Comments
 (0)