How do I set up a default value for a text field? I am trying to setup a default value according to drupal API (http://take.ms/sSbow) in case if the form is empty (before use filled any data) and not successful.
In hook_form_alter() I already added the code via 
$form['#info']['filter-field_geoaddress_proximity']['label'] = t('Distance'); and it works well. Hovewer if I try like these

$form['#info']['filter-field_geoaddress_proximity']['value']['#default_value'] = 21;
$form['field_geoaddress_proximity']['widget'][0]['value']['#default_value'] = 21;


nothing happens.

This my debug info:

Array
(
    [operator] =&gt; field_geoaddress_proximity_op
    [value] =&gt; 2ield_geoaddress_proximity
    [label] =&gt; Drupal\Core\StringTranslation\TranslatableMarkup Object
        (
            [string:protected] =&gt; Distance
            [translatedMarkup:protected] =&gt; 
            [options:protected] =&gt; Array
                (
                )

            [stringTranslation:protected] =&gt; 
            [arguments:protected] =&gt; Array
                (
                )

        )

    [description] =&gt; 
)


Could somebody help me? Doesn't matter it is in hook_form_alter() or any other hook.

Thank you.
Usually you setup the default value when configuring the filter -- if you've got an exposed content:type filter, then you set the default values by selecting one or more content types in the Configure filter criterion dialog.

I wouldn't do this via hook_form_alter (or similar) as you'll be fighting Views the whole way.