I'm so sorry. I found this stupid mistake. The placeholder has the same ID as the input on the first step. Thus respective value is overwritten.
Apr 23, 2024
2
Level 1
Placeholder clears data from previous steps of wizard
Hello all!
I have a wizard form. On the first step I have an input field and on the second - a placeholder controller (an some other inputs). I have realized that, when I submiting a form on the third step, the data from the first step isn't passed. But if I remove the placeholder on the second step, everythind works fine. Could you explein me if it's wrong or not?
public function getSteps(): array
{
return [
Step::make('Product ID')
->description('Write a product id you want to spy')
->schema([
TextInput::make('product_id')
->required()
->reactive()
->default(158292376)
]),
Step::make('Confirmation')
->description('Check a product one more time and confirm you want to spy it')
->schema([
Placeholder::make('product_id')
->content(new HtmlString('<div>Are you sure?</div>')),
TextInput::make('product_id_one_more_time')
->default(158292376)
]),
Step::make('Notifications')
->description('Define what actions to be notifyed')
->schema([
Toggle::make('notify_if_product_name_changed'),
]),
];
}
Level 1
Please or to participate in this conversation.