Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

Settings canvas categories no longer hide correctly #460

Closed Meorawr closed 10 months ago

Meorawr commented 11 months ago

In patch 10.1.7 build 50730 a change was made that breaks canvas layouts in the settings panel such that navigating away from a canvas-based settings category no longer hides it correctly.

Test case

A test case addon is provided: Meorawr_StackedCategoriesBug.zip

  1. With the addon loaded, open the settings panel and select the "AddOns" tab.
  2. Select "Test Canvas 1". A red texture should appear at the top of the frame.
  3. Select "Test Canvas 2". The red texture should hide, and a green texture should appear below it.
  4. Select "Test Canvas 3". The green texture should hide, and a blue texture should appear below it.

Demonstration

The below video shows the broken behaviour as of 10.1.7.50730 - categories we navigate away from no longer hide, and so all three textures will be visible.

https://github.com/Stanzilla/WoWUIBugs/assets/287102/1b7a30d3-1390-482b-9495-b2c2a3911dda

The below video shows the correct behaviour as of 10.1.5.50747 - categories we navigate away from hide correctly and only one texture will be visible at a time.

https://github.com/Stanzilla/WoWUIBugs/assets/287102/4b2b139f-f6bd-4306-9b04-ba87c324fe77

Issue

The change that was made can be found below. By sequencing the DisplayCategory call after SetCurrentCategory this block within DisplayLayout incorrectly hides the newly selected category - before then re-showing it - rather than operating on the old one. As such, the old category remains fully anchored and visible and multiple categories show at once.

diff --git a/Interface/SharedXML/Settings/Blizzard_SettingsPanel.lua b/Interface/SharedXML/Settings/Blizzard_SettingsPanel.lua
index a0e49a4a..a31ec919 100644
--- a/Interface/SharedXML/Settings/Blizzard_SettingsPanel.lua
+++ b/Interface/SharedXML/Settings/Blizzard_SettingsPanel.lua
@@ -796,8 +796,8 @@ function SettingsPanelMixin:SelectCategory(category, force)
    if force or (self:GetCurrentCategory() ~= category) then
        self:ClearSearchBox();
        self:ClearOutputText();
-       self:DisplayCategory(category);
        self:SetCurrentCategory(category);
+       self:DisplayCategory(category);
    end
 end
Meorawr commented 10 months ago

Fixed in 10.1.7.51059.