Skip to content

Required fields are not checked on final step of Wizard #2156

@pootedesu

Description

@pootedesu

Expected Behavior
Clicking "Finish" on the final page of a Wizard will check all required fields and prompt for any blank fields before moving forward.

Actual Behavior
Clicking "Finish" displays the finish screen and ignores required fields.

<?php

declare(strict_types=1);

namespace Atk4\Ui\Demos;

use Atk4\Ui\Form;
use Atk4\Ui\Header;
use Atk4\Ui\Wizard;

/** @var App $app */
require_once __DIR__ . '/../init-app.php';

$wizard = Wizard::addTo($app);

$stepFx = static function (Wizard $wizard) {
    $form = Form::addTo($wizard);
    $form->addControl('city', [], ['required' => true]);
    $form->onSubmit(static function (Form $form) use ($wizard) {
        return $wizard->jsNext();
    });
};
$wizard->addStep(['Step 1'], $stepFx);
$wizard->addStep(['Step 2'], $stepFx);

$wizard->addFinish(static function (Wizard $wizard) {
    Header::addTo($wizard, ['Wizard completed']);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions