UI Dropdown does not drop.

Hello.

I have encountered interesting problem. I place my Dropdown UI element in my canvas. By default this dropdown already has three elements to choose.

Then I click to start. When I click to this Dropdown element, nothing happens. Its hidden content which is needed to be chosed, does not show.

Why this is happening?

Also, check child object with name “Dropdown List” in DropDown root. It appears when you click on component to show drop down list. “Dropdown List” has Canvas and it’s sorting layer is Default after creating. You can have other canvases on your scene with other sorting layers that will be hide your drop down list.

p.s. Also you should change sorting layer for object with name “Blocker”. Blocker helps to close drop down list after tap (or click) on any other screen position.

I’ve wrote short script for example (is uses UniRx - reactive extensions and TextMesh Pro Drop Down List):

  [RequireComponent(typeof(TMP_Dropdown))]
    public class DropDownCanvasLayerSetter : MonoBehaviour
    {
        private TMP_Dropdown _dd;

        private const string BlockerObjectName = "Blocker";
        private const string CanvasDefaultSortingLayerName = "UI";

        private void Awake()
        {
            _dd = GetComponent<TMP_Dropdown>();

            _dd.ObserveEveryValueChanged(dropdown => dropdown.IsExpanded)
                .Where(isExpanded => isExpanded)
                .Subscribe(isExpanded =>
                {
                    var canvases = _dd.GetComponentsInChildren<Canvas>().ToList();


                    var blocker = FindObjectsOfType<Canvas>().FirstOrDefault(canvas => name == BlockerObjectName);
                    if (blocker != null) canvases.Add(blocker);

                    foreach (var canvase in canvases)
                    {
                        canvase.sortingLayerName = CanvasDefaultSortingLayerName;
                    }

                }).AddTo(_dd);
        }
    }

I am having the same issue. I am using Unity version 5.4.2f1. The dropdown was working in my last version; however, not that I updated to the aforementioned version it does not work properly. Basically, i am able to select an item out of the drop box from the start; however, if I tap on the dropdown box a second time in order to make another selection it will not expand to show me my other options. PLEASE HELP…THIS IS FOR AN APP THAT IS IN PRODUCTION…

Seems this issue is fixed in 5.6 onwards but I have a work around for 5.5:

After making the canvas inactive, destroy the “Dropdown List” child of the DropDown. This will get created automatically when the drop down is rendered next time.

Transform dropDownList = canvas.transform.FindChild ("<path>/<to>/Dropdown List");
if (dropDownList != null) {
	Destroy(dropDownList.gameObject);
}

Worked for me.

Having this issue in 2017.2. Weirdly enough the dropdown only drops down when its anchor and pivot are in the center of the screen. If I set its anchor and pivot to the top of the screen then it won’t drop down.

Excelent workarround here

I solved this issue by adding a Canvas component to the “Template” object and uncheck “Override Sorting”, so that the dynamically generated “Dropdown List” will appear on the correct sorting layer.

For anyone who encounters this now (2019.3 era):

  • Dropdown Canvas sort order is set to 30000 when it appears, but supports up to short.MaxValue.
    so if you use short.MaxValue for top most canvases, dropdowns will always show behind your canvas.

Only use a sort-order less than 30000 for any canvas which has controls.

What worked for me was, Creating a new Canvas object, moving all the old Canvas children to the newly created Canvas, and deleting the old Canvas.