Lost setting of the custom field when editing a page I created a content type with my own custom field as described in Why do I get this error when I save my custom field?

The insertion of an item with this content type works, but when I want to modify the article I verified that I lose my custom field setting (it's a select box).

What is the method to keep the setting?
According to the code in the mentioned question, you need to define #default_value property and assign the $value variable to it like this:  

public function formElement(FieldItemListInterface $items, $delta, array $element, array &amp;$form, FormStateInterface $form_state) {

    $value = isset($items[$delta]-&gt;value) ? $items[$delta]-&gt;value : '';
    $client   = \Drupal::httpClient();
    $request = $client-&gt;get('http://localhost:8083/regionilist');
    $response = json_decode($request-&gt;getBody());

    $element += [
      '#type' =&gt; 'select',
      '#title' =&gt; $this-&gt;t('Select element'),
      '#options' =&gt; $response,
      '#suffix' =&gt; '&lt;div class="custom-field-widget"&gt;&lt;/div&gt;',
      '#attributes' =&gt; ['class' =&gt; ['edit-custom-field-widget']],
      '#attached' =&gt; [
        'library' =&gt; [
          'custom_field/my_js_custom_field',
        ],
      ],
      '#default_value` =&gt; $value,
    ];

    return ['value' =&gt; $element];
  }