diff --git a/Init/Init.lua b/Init/Init.lua index de2fa40b..038f3a21 100644 --- a/Init/Init.lua +++ b/Init/Init.lua @@ -523,7 +523,10 @@ function CraftSim.INIT:HideAllModules(keepControlPanel) end -- hide all modules CraftSim.RECIPE_SCAN.frame:Hide() - CraftSim.CRAFTQ.frame:Hide() + -- Skip hiding CraftQueue frame if user is editing a craft amount input + if not (CraftSim.CRAFTQ.UI and CraftSim.CRAFTQ.UI.HasFocusedInput and CraftSim.CRAFTQ.UI:HasFocusedInput()) then + CraftSim.CRAFTQ.frame:Hide() + end CraftSim.CRAFT_BUFFS.frame:Hide() CraftSim.CRAFT_BUFFS.frameWO:Hide() CraftSim.COOLDOWNS.frame:Hide() @@ -725,8 +728,11 @@ function CraftSim.INIT:TriggerModulesByRecipeType() end -- update CraftQ Display (e.g. cause of profession gear changes) - CraftSim.CRAFTQ.UI:UpdateDisplay() - CraftSim.CRAFTQ.UI:UpdateAddOpenRecipeButton(recipeData) + -- Skip CraftQueue update if user is editing a craft amount input to prevent focus loss + if not (CraftSim.CRAFTQ.UI.HasFocusedInput and CraftSim.CRAFTQ.UI:HasFocusedInput()) then + CraftSim.CRAFTQ.UI:UpdateDisplay() + CraftSim.CRAFTQ.UI:UpdateAddOpenRecipeButton(recipeData) + end -- Simulation Mode (always update first because it changes recipeData based on simMode inputs) showSimulationMode = (showSimulationMode and recipeData and not recipeData.isSalvageRecipe) or false diff --git a/Modules/CraftQueue/UI.lua b/Modules/CraftQueue/UI.lua index 528688ca..455f97a9 100644 --- a/Modules/CraftQueue/UI.lua +++ b/Modules/CraftQueue/UI.lua @@ -1762,6 +1762,25 @@ function CraftSim.CRAFTQ.UI:UpdateDisplay() CraftSim.CRAFTQ.UI:UpdateQueueDisplay() end +--- Returns true if any craft amount input in the queue list currently has focus +function CraftSim.CRAFTQ.UI:HasFocusedInput() + local queueTab = CraftSim.CRAFTQ.frame and CraftSim.CRAFTQ.frame.content and + CraftSim.CRAFTQ.frame.content.queueTab + if not queueTab then return false end + local craftList = queueTab.content and queueTab.content.craftList + if not craftList or not craftList.activeRows then return false end + for _, row in pairs(craftList.activeRows) do + local craftAmountColumn = row.columns and row.columns[9] + if craftAmountColumn and craftAmountColumn.input and + craftAmountColumn.input.textInput and + craftAmountColumn.input.textInput.frame and + craftAmountColumn.input.textInput.frame:HasFocus() then + return true + end + end + return false +end + ---@param craftQueueItem CraftSim.CraftQueueItem function CraftSim.CRAFTQ.UI:UpdateEditRecipeFrameDisplay(craftQueueItem) ---@type CraftSim.CRAFTQ.EditRecipeFrame