How do I get a full-fledged entity browser with the current items list on a webform, or any custom form?
I know that adding the basic field is easy enough using hook_form_alter():
$form['field_people'] = array( '#type' => 'entity_browser', '#entity_browser' => 'people', '#cardinality' => 1, );
But this doesn't include the "current items" list that gets updated via AJAX when an item is selected in the browser.
As far as I can tell, that is all set up by the widget settings associated with the form display -- something that a custom form (like a webform) wouldn't have.
Here's a related issue, but it stops short of explaining how to get the widget to work: https://www.drupal.org/project/entity_browser/issues/2816881#comment-11719437
Any ideas? Thanks!