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

Dropdown options - can I hide selected one?

Discussion in 'UGUI & TextMesh Pro' started by ainara4holition, Jan 26, 2022.

  1. ainara4holition

    ainara4holition

    Joined:
    Aug 7, 2020
    Posts:
    18
    Hello!
    I am using a Dropdown menu and I would like to hide the selected value from the dropdown list. Is this posible?

    I create the options programmatically generating a list of OptionData objects and passing that to the dropdown.options.

    In my example of a language dropdown menu, the selected one is English, so I'd like to remove English from the list.

    I have been looking at the reference and manual and I cant seem to find the way. Any help or hints much appreciated. Thank you :)
     
    Last edited: Jan 27, 2022
  2. ainara4holition

    ainara4holition

    Joined:
    Aug 7, 2020
    Posts:
    18
    I managed to do this by
    - moving the selected option to the bottom of the options list
    - disabling the last item created on the Dropdown list