F
Filament13mo ago
Mambi

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
LeandroFerreira
LeandroFerreira13mo ago
Can you share the whole code please?
Mambi
Mambi13mo ago
@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
Dan Harrin
Dan Harrin13mo ago
please do not @ me, #✅┊rules. open an issue on GitHub with a reproduction repository and we will take a look at some point
Mambi
Mambi13mo ago
sorry for the @
LeandroFerreira
LeandroFerreira13mo ago
It was supposed to work. Can you share the code on github please?
Mambi
Mambi13mo ago
here's the repo https://github.com/Mambi/filament-wizard.git to be tested with Safari
GitHub
GitHub - Mambi/filament-wizard
Contribute to Mambi/filament-wizard development by creating an account on GitHub.
LeandroFerreira
LeandroFerreira13mo ago
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.
Mambi
Mambi13mo ago
Are you using Safari ? if yes what's your version ?
LeandroFerreira
LeandroFerreira13mo ago
chrome, firefox. What about this page? https://demo.filamentphp.com/shop/orders/create Any console erros?
Mambi
Mambi13mo ago
this demo is working correctly on Safari is it a filament version issue ?
LeandroFerreira
LeandroFerreira13mo ago
your project https://github.com/Mambi/filament-wizard.git is running here without issues
GitHub
GitHub - Mambi/filament-wizard
Contribute to Mambi/filament-wizard development by creating an account on GitHub.
Mambi
Mambi13mo ago
have you tried it on safari browser (Mac) ?
LeandroFerreira
LeandroFerreira13mo ago
I don't use Mac. But is the safari the issue? Did you try it on Chrome/Firefox?
Mambi
Mambi13mo ago
on Chrome it's running without issue but not on Safari
LeandroFerreira
LeandroFerreira13mo ago
uninstall safari Lol
Aditio
Aditio5mo ago
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?
Aditio
Aditio5mo ago
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()
No description
Want results from more Discord servers?
Add your server
More Posts