@bokorir I’m trying to achieve almost the same result using select2: the main difference is that I’m querying an external source (MongoDB returning json data).
I have copied most of the code from the taxonomy field and I looked at post_object, too.
As you, if I specify $field['ui'] = 1;
the select field is rendered in the HTML code but it remains hidden.
If I remove the ‘ui’ setting or change it to 0, the select field is shown but it is disabled.