Commit a63c2fad authored by leopaccanaro's avatar leopaccanaro Committed by TravisCarden

Issue #2906215 by leonardop@ciandt.com, TravisCarden: Keep Active Tab After Submission

parent 918d31b1
......@@ -171,8 +171,17 @@ class ChecklistapiChecklistForm implements FormInterface {
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
/** @var \Drupal\checklistapi\ChecklistapiChecklist $checklist */
$checklist = $form['#checklist'];
// Save progress.
$values = $form_state->getValue('checklistapi');
$form['#checklist']->saveProgress($values);
$checklist->saveProgress($values);
// Preserve the active tab after submission.
$form_state->setRedirect($checklist->getRouteName(), [], [
'fragment' => $values['checklistapi__active_tab'],
]);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment