Search Unity

Feature Request Make PopupField constructor not require a default value

Discussion in 'UIElements' started by taylank, Oct 4, 2019.

  1. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    111
    I really like PopupField but there is one thing that's constantly bugging me about it. Initializing it becomes tricky when the list it's supposed to get its values from is not yet populated. Yes, I could just initialize my list with a dummy item, but then I or the user has to remember to get rid of the dummy value once it is no longer needed.

    So how about having a constructor argument for PopupField to display a built-in dummy option (default T or something) until a real value becomes available?

    If there is another way to solve the problem, I'd love to hear that too.
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    295
    I suggest you implement a custom control that inherits from PopupField. It's not too bad and you can still expose it to UXML for your users.