How to disable form button on ajax callback?
In your ajax callback function write the code to disable button. like:

public function ajax_function(array &amp;$form, FormStateInterface $form_state) {
    $form['my_button']['#attributes']['disabled'] = true;
    return $form['my_button'];
}


Hope it helps!