dropdown choiceTooltips can interfere with other addons
sirinsidiator opened this issue · 1 comments
User Gandalf has reported in the comments that the current way how LAM registers the choiceTooltips on a dropdown can interfere with other addons:
The prehook function ShowTooltip interferce with other addons prehooking m_comboBox for adding their tooltips.
A check whether control.tooltip actually exists is missing.
As a consequence if this hook is triggered by an other addon, the gobal InformationTooltip will be cleared. A check should be added:
local function SetupTooltips(comboBox, choicesTooltips)
#75 local function ShowTooltip(control)
#75.1 if not control.tooltip then return end -- proposed fix
#76 InitializeTooltip(InformationTooltip, control, TOPLEFT, 0, 0, BOTTOMRIGHT)
#77 SetTooltipText(InformationTooltip, LAM.util.GetStringFromValue(control.tooltip))
#78 InformationTooltipTopLevel:BringWindowToTop()
#79 end
Should also investigate if making use of the new handler namespaces could lead to a more robust solution than the current one.
The interference isn't actually a problem, since other addons are supposed to use the choiceTooltips feature instead of manually hooking into the comboBox. That aside, there really is some room for improvement with the new way to set handlers which will provide better compatibility with hypothetical hooks by other addons.