function AjaxTestFocusFirstForm::focusFirstInForm

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestFocusFirstForm.php \Drupal\ajax_test\Form\AjaxTestFocusFirstForm::focusFirstInForm()
  2. 10 core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestFocusFirstForm.php \Drupal\ajax_test\Form\AjaxTestFocusFirstForm::focusFirstInForm()

Callback for testing FocusFirstCommand on a form.

Return value

\Drupal\Core\Ajax\AjaxResponse The AJAX response.

File

core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestFocusFirstForm.php, line 209

Class

AjaxTestFocusFirstForm
Form for testing AJAX FocusFirstCommand.

Namespace

Drupal\ajax_test\Form

Code

public function focusFirstInForm() {
    $response = new AjaxResponse();
    return $response->addCommand(new FocusFirstCommand('#ajax-test-focus-first-command-form'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.