Wizard no field displayed
can anyone tell me why no filed is displayed while using this simple wizard
public static function form(Form $form): Form
{
return $form
->schema([
Wizard::make([
Wizard\Step::make('step-1')
->schema([
TextInput::make('name')
->required()
]),
Wizard\Step::make('step-2')
->schema([
TextInput::make('email')
->required()
]),
Wizard\Step::make('step-2')
->schema([
TextInput::make('phone')
->required()
]),
])
]);
}
17 Replies
Can you share the whole code please?
@leandro_ferreira i'm using a fresh install of laravel and filament
here's my resssource page
class CustomerResource extends Resource
{
protected static ?string $model = Customer::class;
protected static ?string $navigationIcon = 'heroicon-o-collection';
public static function form(Form $form): Form
{
return $form
->schema([
Wizard::make([
Wizard\Step::make('step-1')
->schema([
TextInput::make('name')
->required()
]),
Wizard\Step::make('step-2')
->schema([
TextInput::make('email')
->required()
]),
Wizard\Step::make('step-3')
->schema([
TextInput::make('phone')
->required()
]),
]),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([...])
}
public static function getPages(): array
{
return [
'index' => Pages\ListCustomers::route('/'),
'create' => Pages\CreateCustomer::route('/create'),
'edit' => Pages\EditCustomer::route('/{record}/edit'),
];
}
}
@leandro_ferreira i've this error in the console TypeError: this.getSteps().at is not a function. (In 'this.getSteps().at(0)', 'this.getSteps().at' is undefined)
@leandro_ferreira i noticed that if i use skippable and i click on tab 1 fields are shown !
@Dan Harrin please look at this case, this issue appears only on Safari, i've tested my code on brave and it works correctly
please do not @ me, #✅┊rules. open an issue on GitHub with a reproduction repository and we will take a look at some point
sorry for the @
It was supposed to work.
Can you share the code on github please?
GitHub
GitHub - Mambi/filament-wizard
Contribute to Mambi/filament-wizard development by creating an account on GitHub.
looks good for me
if you are using wizard on resources, try this: https://filamentphp.com/docs/2.x/admin/resources/creating-records#wizards
Filament
Creating records - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
Are you using Safari ? if yes what's your version ?
chrome, firefox. What about this page? https://demo.filamentphp.com/shop/orders/create
Any console erros?
this demo is working correctly on Safari
is it a filament version issue ?
GitHub
GitHub - Mambi/filament-wizard
Contribute to Mambi/filament-wizard development by creating an account on GitHub.
have you tried it on safari browser (Mac) ?
I don't use Mac. But is the safari the issue? Did you try it on Chrome/Firefox?
on Chrome it's running without issue but not on Safari
uninstall safari Lol
Hi, I'm also having this issue. I've just looked at console there is problem in
getSteps()
function. Is there way to workaround this?I think I found a solution for this. It should only be issue for Safari version < 16.
It's because Safari cannot define
.at(index)
function in order to get array by index.
You can just publish Filament's blade component by typing command php artisan vendor:publish
and search for filament-forms-views
.
Now, all you have to do is go to /resources/views/vendor/filament-forms/components
and find blade component for wizard.blade.php
Find Alpine's directive x-init
and change line step = getSteps().at({{ $getStartStep() - 1}})
to step = getSteps()[{{ $getStartStep() - 1 }}]
Below is code changes as following:
$watch('step', () => updateQueryString()) //step = getSteps().at({{ $getStartStep() - 1 }})step = getSteps()[{{ $getStartStep() - 1 }}] autofocusFields()