8 – Field Entity Autocomplete filter the published nodes

my problem is that I have a custom form with an autocomplete entity field for the search.
The problem is that the field shows me both the published fields and those that do not. Is there any filter or parameter to prevent this from happening?

$form('my_element') = array(
'#type' => 'entity_autocomplete',
'#target_type' => 'node',
'#selection_settings' => (
    'target_bundles' => array('products'),