Bug in SortHeaderGroup
I stumbled upon it when trying to set a default sorting for my add-on.
The bug is: 'OnHeaderClicked' is ignoring the initial direction given by ZO_SortHeader_Initialize. Let's take a look: File esoui\libraries\zo_sortheadergroup\zo_sortheadergroup.lua, from line 149 to 165 Lua Code:
Upon first calling 'OnHeaderClicked' (whether by clicking on the header or calling 'SelectHeaderByKey'), the line that sets 'sortDirection' always gets true, no matter what. I think the problem is the use of 'x and y or z', since sortDirection is a boolean flag, it's tricky to use this ternary-ish conditional instead of a full body if/else. Edit. Yes! As I suspected, changing the line Lua Code:
to Lua Code:
Fixed the problem! I always found 'x and y or z' smelly, a mine waiting to be detonated. :P |
You're totally right, that line doesn't do what it should. Btw http://www.esoui.com/forums/showpost...64&postcount=8 ^^
|
Quote:
Another thing that bothers me is: if you check the sort function for comparing rows in a scroll list, it accepts a flag in the sort keys options called "isNumeric" to know when to compare numeric values. But, in esoui\ingame\mail\mailinbox_shared.lua it reads "numeric" (without the prefix 'is'). I think it's misspelled but since I never took the time to look for other instances I never reported. Well, I am now. :P Edit. I was reading the link you mentioned. I notice now that there are bugs everywhere around SORT_ORDER_UP and SORT_ORDER_DOWN, and I think it's because they're booleans. Wouldn't it be better if they used 0 and 1? |
Quote:
Quote:
|
All times are GMT -6. The time now is 08:21 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI