Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question ui toolkit dropdown popup direction

Discussion in 'UI Toolkit' started by AceJiang, Jan 10, 2023.

  1. AceJiang

    AceJiang

    Joined:
    Dec 14, 2019
    Posts:
    13
    current dropdown box is down by default, but how to up?
     
  2. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    699
    You'd need to change its position and set flex-direction to reverse, I'm not near my computer so I can't give details.
     
  3. AceJiang

    AceJiang

    Joined:
    Dec 14, 2019
    Posts:
    13
    Thank you dlorre. set position and flex did not realize. I thing should use uss, like ".unity-base-popup-field__text" or ".unity-base-popup-field__arrow" to change, but I can't find the uss selectors.
     
  4. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    699
    Look in the toolkit debugger when the popup is open, actually it is a sibling to the UI Document, you will see it at the very bottom of the list. Tweak it with debugger then you'll find which classes to change.
     
  5. C-UITools

    C-UITools

    Unity Technologies

    Joined:
    Jun 23, 2021
    Posts:
    21
    Hello,

    Thank you for your question. The menu that pops up when using a DropdownField is actually an OS-driven menu, so you cannot modify its direction. It will automatically adjust per OS, with the direction being up->down by default.

    Customizing the DropdownField is something that we are working on, but there's no ETA on when the update will drop. In the meantime, if this is something that is crucial to you, you could recreate your own dropdown menu using other Controls in UIToolkit.

    Hope this helps!
     
  6. AceJiang

    AceJiang

    Joined:
    Dec 14, 2019
    Posts:
    13
    if uitoolkit >= ugui then
    use
    end
     
  7. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    699