How to expose an entity reference field as a filter on a custom entity in Views? I have a field on a custom entity that is an entity reference to a node. However when I select this field as a filter and expose it, it just acts like a numeric field instead of a reference field (only option is less than, greater than, equal to... etc).

How can I make this field act properly? I just want a drop down of options (only 32 nodes ever) to make filtering easy.
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.