How to expose an entity reference field as a filter on a custom entity in Views?
I think there are many solutions but I resolved the same problem in the hook
hook_form_alter()
altering the form element type from textfield to select and populate the #option attribute:

  $options = _getOptions();
  $form['your_field'] = [
    '#type' =&gt; 'select',
    '#options' =&gt; $options,
  ];


Other solutions are appreciated.