Search Unity

TextMesh Pro Huge bug, missing a code line since 1.4.0

Discussion in 'UGUI & TextMesh Pro' started by Arokma, Jun 11, 2019.

  1. Arokma

    Arokma

    Joined:
    Oct 14, 2015
    Posts:
    20
    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) :

    Code (CSharp):
    1. protected override void OnDisable()
    2.         {
    3.             //Destroy dropdown and blocker in case user deactivates the dropdown when they click an option (case 935649)
    4.             ImmediateDestroyDropdownList();
    5.  
    6.             if (m_Blocker != null)
    7.                 DestroyBlocker(m_Blocker);
    8.             m_Blocker = null;
    9.             base.OnDisable();     //YOU MISSED THAT
    10.         }
    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.
     
    kustom likes this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    To be honest, when other Unity teams updated the Dropdown, I mirrored their changes and apparently inherited that issue ;)

    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.
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    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.
     

    Attached Files:

  4. Arokma

    Arokma

    Joined:
    Oct 14, 2015
    Posts:
    20
    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 ;)
     
    Stephan_B likes this.
  5. Skjalg

    Skjalg

    Joined:
    May 25, 2009
    Posts:
    211
    This is still an issue in the current 2019.3.7f1 verified 2.0.1 package. An update would be nice @Stephan_B :)

    Sorry, didn't realize you had already shipped a number of updates labeled 2.1.0 preview :)
     
    Last edited: Apr 6, 2020