#default_value Not Working In Select Field First off, I have tried to do my homework before coming here. I have referenced this, and this and I still cannot get my code to work.

I am simply trying to set a default value in a select form field on a Drupal 8 block configuration form. Here are the relevant parts of my code:

$options = array(
  'test' =&gt; 'value',
  'random' =&gt; 'string',
  'kiwi' =&gt; 'pear',
);

$form['menu_selected'] = array(
  '#type' =&gt; 'select',
  '#title' =&gt; 'Test Title',
  '#description' =&gt; 'Test Description',
  '#options' =&gt; $options,
  '#default_value' =&gt; 'random',
);


The $form then gets returned as per usual in a block build. Everything else works in the form; The options populate, the description and title display. The only thing that doesn't work is the default value. I have tried using keys and values. I even saw a comment that said to use '#value' instead of '#default_value' and still it didn't work. Can someone please tell me what I'm doing wrong? I can provide more code if needed.
On Drupal 8 form, I was having an issue with Firefox that was caching the value of a select field, selected by the user before refreshing the page.

It was basically overriding the #default_value of the field.

My solution was to Turn Off Form Autocompletion (https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion). 

You can do it at the level on the input if that's an input, but since it was a select in my case I had to do it at the form level :

$form['#attributes']['autocomplete'] = 'off';