Search Unity

Question How to bind popup text fields to serialized properties

Discussion in 'UI Toolkit' started by hawaiian_lasagne, Mar 8, 2023.

  1. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    123
    I am creating a PopupField<MyItemType> and using the formatListItemCallback and formatSelectedValueCallback callbacks to format the string from MyItemType.

    How do I bind the text of the popup text element to the instance of MyItemType properly? As when I change a field in MyItemType the popup doesn't update.

    I feel like I want something similar to the bindItem callbacks on the ListView, where I can manually bind the actual popup item to the data, rather than running the format selected value callbacks.