There’s good news there! Creating your own popupfield is quite trivial and is likely a good starter project if you’re just getting your feet wet with uielements.
public class BrowserPopupField<T> : BaseField<T>, IBrowserPopupField {
public BrowserPopupField(string label) : base(label, new VisualElement() { name = "sr-visual-element" }) {
PopupWindowText = string.Format("Select {0}...", label);
PopupWindowSize = new Vector2(300, 400);
this.AddClasses("unity-base-popup-field", "unity-popup-field");
visualElement = this.Q("sr-visual-element");
visualElement.AddClasses("unity-base-field__input", "unity-base-popup-field__input", "unity-popup-field__input");
popupLabel = new Label();
visualElement.AddClasses("unity-text-element", "unity-base-popupfield-text");
popupLabel.style.flexGrow = 1;
popupLabel.pickingMode = PickingMode.Position;
popupLabel.text = EmptyLabelText;
popupLabel.RegisterCallback<MouseDownEvent>(e => {
if (e.button == 0 && e.clickCount == 1) {
e.StopPropagation();
}
});
popupLabel.RegisterCallback<ClickEvent>(e => {
if (e.button == 0) {
e.StopPropagation();
OpenPopupContent();
}
});
Add(popupLabel);
visualElement.Add(popupLabel);
var dropdown = new VisualElement();
dropdown.AddClasses("unity-base-popup-field__arrow");
visualElement.Add(dropdown);
}
Here’s the constructor from mine - will help you get the visual styles down as well as the click events. From there you just need to display a popup or context menu.