Search Unity

Dropdown UI - doesn't show content when opened and "seems" to hang the event system?

Discussion in 'UGUI & TextMesh Pro' started by shalevy2888, May 22, 2017.

  1. shalevy2888

    shalevy2888

    Joined:
    Nov 16, 2016
    Posts:
    4
    Hi All,
    I have been trying to debug a problem I'm having in the last few days with no success. I assume the bug is somewhere in my code and not in the unity library and I'm looking for tips and things to try.

    I have a prefab 3D object that has a hidden Canvas with a dropbox inside that canvas.

    If the player clicks on that object and press the edit button (part of my game mechanism, not related to the problem) -> I take the canvas and using SetParent() on it's transform changes the parent to a different Canvas.
    When the player clicks on the dropdown arrow, the dropdown doesn't show any option, it stops responding and every other UI element stops responding.
    If I delete the dropdown list (during gameplay, from the project browser) that is generated from the template, it starts reacting again, but once opening it still has the same bad behavior.

    Any idea why it happens? What can I try?

    Thanks,
    Shay
     
  2. shalevy2888

    shalevy2888

    Joined:
    Nov 16, 2016
    Posts:
    4
  3. Rational-MA

    Rational-MA

    Joined:
    Mar 6, 2015
    Posts:
    59
    What version of unity are you running? Something very similar to this was fixed in 5.6.0 Patch 3.
     
  4. shalevy2888

    shalevy2888

    Joined:
    Nov 16, 2016
    Posts:
    4
    I'm using 5.6.1f1 personal. I updated today (previous version was updated about a month ago). The issue still exists.
     
  5. Rational-MA

    Rational-MA

    Joined:
    Mar 6, 2015
    Posts:
    59
    One thing to check is your test case. The issue before dealt with NaN in the transform values of scroll rect and/or it's viewport/content target. If it's the same test case I would check your gameobject and zero out any NaN's leftover pre-patch. Otherwise you may have to file a new bug report.
     
  6. shalevy2888

    shalevy2888

    Joined:
    Nov 16, 2016
    Posts:
    4
    Thanks, that solved it. The scrollbar value had an NaN. I noticed that before and suspected that's the issue, but couldn't debug it. I had to re-create the prefab with a new dropdown to fix the issue.
    BTW, I was searching the release note yesterday when I downloaded the new Unity release to see if indeed there was a bug in the dropdown and could not see a note about that...

    In any case, issue solved :)
    Thanks,
    Shay
     
  7. Rational-MA

    Rational-MA

    Joined:
    Mar 6, 2015
    Posts:
    59
    Glad it helped! The bug was in the release notes, but it came out before in 5.6.0p3 or p4