Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Dropdown List's Sorting Layer not compatible with multiple canvases with different sorting layers

Discussion in 'UGUI & TextMesh Pro' started by cm16, May 15, 2024.

  1. cm16

    cm16

    Joined:
    Sep 11, 2017
    Posts:
    1
    related issue: https://issuetracker.unity3d.com/is...-parent-canvas-layer-when-the-panel-is-opened

    At File TMP_Dropdown.cs, Line 816:
    Code (CSharp):
    1.             // popupCanvas used to assume the root canvas had the default sorting Layer, next line fixes (case 958281 - [UI] Dropdown list does not copy the parent canvas layer when the panel is opened)
    2.             m_Template.GetComponent<Canvas>().sortingLayerID = rootCanvas.sortingLayerID;
    This makes the sorting layer of dropdown list always changed to the sorting layer of the root canvas, and I can not set the sorting layer manually.

    However, when I have a hierarchy like:
    Code (CSharp):
    1. └─ Canvas1(Sorting Layer 1)
    2.       ├─  Canvas2(Sorting Layer 2)
    3.       │      └─Dropdown1
    4.       └─  Canvas3(Sorting Layer 3)
    5.              └─Dropdown2
    The sorting layers of Dropdown1 and Dropdown2 are always set to "Sorting Layer 1", which makes them render behind "Sorting Layer 2" and "Sorting Layer 3".
     
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    709
    Hey, if you think you found a bug, please report it through Help > Report a Bug inside the Unity Editor.