How to get id of selected entity in an "entity_autocomplete" form element? I have a form element of "entity_autocomplete" type. 
Also I have an ajax callback of the element.
Here is its code.

$form['autocomplete_places'] = [
            '#type' =&gt; 'entity_autocomplete',
            '#target_type' =&gt; 'node',
            '#selection_settings' =&gt; [
                'target_bundles' =&gt; ['place'],
            ],
            '#ajax' =&gt; [
                'callback' =&gt; '::autocompleteGetPlaces',
                'event' =&gt; 'autocompleteselect',
            ]
        ];

public function autocompleteGetPlaces(array &amp;$form, FormStateInterface $form_state){
        $ajax_responce = new AjaxResponse();
/// some code here 
        return $ajax_responce;
    }


Unfortunately, I can't find out how to get the id of selected entity inside the ajax callback function. For example, in my case, it would be id of a node of "place" type. 

I tried to debug it, but couldn't find information about it in $form_state.

Could you clarify me, how to do it ?
Seemingly I managed to find the solution.

The event for the autocomplete element should be "autocompleteclose" instead "autocompleteselect". 
And in this case it's possible to get entity_id via 

$entity_id = $form_state-&gt;getValue('autocomplete_places');


if the list of values was closed without selected element then $form_state->getValue('autocomplete_places') is null.