How do I alter a form using an AJAX callback? I have this callback function triggered by an onChange() event in another select box.
This code, however, doesn't make the field enabled

public static function changeForm(array &amp;$form, FormStateInterface $form_state) : array {
  $form['field_my_custom_field']['#disabled'] = FALSE;
  return $form;
}


What am I doing wrong?
Ajax Forms in Drupal 7 states:


  Changes to the form must only be made in the form builder function. The callback function must not alter the form or any other state.


In form build/alter, check $form_state-&gt;getTriggeringElement() for the triggering element and then enable the field.