How to configure chosen on Form API with an entity_automcomplete widget? How to configure chosen field on Form API with drupal 8.
I have already installed chosen and it's works in User Interface and not in form API.

This peace of code doesn't work:

          $form['tags'] = array(
        '#type' =&gt; 'entity_autocomplete', 
       '#chosen' =&gt; TRUE,
        '#target_type' =&gt; 'taxonomy_term',
        '#selection_settings' =&gt; ['target_bundles' =&gt; ['tags']],
        '#title' =&gt; ('Tags'), 
        '#empty_value' =&gt; '' 
       ;
I guess you can't becuase you are using and autocompelte widget, but module states:


  Chosen uses the Chosen jQuery plugin to make your  elements
  more user-friendly.


So you have to refactor your form to use a select element, not autocomplete.