Huge bug, missing a code line since 1.4.0

Hi,
I have been messing around with a huge bug for a few days which was breaking all the UI Navigation if a dropdown appeared on the screen at some time. Not opened, not selected, just appearing somewhere.
The issue was here after updating Unity and TextMeshPro to the latest versions.

I went through a lot of versions of TextMeshPro and found the source of the problem, a function you added back when updating to 1.4.0 in the TMP_Dropdown.cs script line 458 (since 1.4.0) :

protected override void OnDisable()
        {
            //Destroy dropdown and blocker in case user deactivates the dropdown when they click an option (case 935649)
            ImmediateDestroyDropdownList();

            if (m_Blocker != null)
                DestroyBlocker(m_Blocker);
            m_Blocker = null;
            base.OnDisable();     //YOU MISSED THAT
        }

As said in comment, you replaced the OnDisable() function of Selectable class but did not call the base OnDisable() function after that, preventing the Selectable from being removed from the active Selectables when OnDisable() is called and thus, breaking the navigation for other menus.

I’m surprised I did not see anyone talking about this huge bug somewhere.

Hope you correct it soon, I added the line to the latest version (2.0.1) on my project and everything went back to normal.

Keep up the good work !
Rémi from Arokma.

1 Like

To be honest, when other Unity teams updated the Dropdown, I mirrored their changes and apparently inherited that issue :wink:

So good catch and I have already made the change on my end so this will be in version 1.4.2 and 2.0.2.

Here is a revised TMP_Dropdown.cs which includes a few other changes made to the UI version of the Dropdown. Give this revised version a spin and let me know if you run into any issues with it.

4637170–435061–TMP_Dropdown.cs (44.1 KB)

Nice, I am looking forward to see the update live as scripts inside the packages are not synched by Collaborate and for now, each member of our team needs to apply those changes locally.

I just compared and tested your script and everything seems to be fine for every transition mode!
Thanks :wink:

1 Like

This is still an issue in the current 2019.3.7f1 verified 2.0.1 package. An update would be nice @Stephan_B :slight_smile:

Sorry, didn’t realize you had already shipped a number of updates labeled 2.1.0 preview :slight_smile: